DAX Function Guide
CALCULATETABLE
Sam McKay
CEO & Founder
How does the CALCULATETABLE work?
CALCULATETABLE Formula Syntax
CALCULATETABLE(
<expression>, <filter1>, <filter2>,…
)
How do you use the CALCULATETABLE?
The CALCULATETABLE function changes the context in which data is filtered, and evaluates the expression in the new context.
For each column used in a filter argument, any existing filters are removed, and the filter used in the filter argument will be used instead.
Related Blog Posts
Loading
Considerations when using the CALCULATETABLE?
The first parameter must be a function that returns a table. There are also restrictions applied to arguments that are Boolean expressions: the expression cannot reference a measure, it cannot be used as a nested CALCULATE function nor it can be used in any function that scans or returns a table, such as aggregation functions.
However, a Boolean expression can use any function that looks up a single value or calculates a scalar value.
Related Video Tutorials
Loading
Formula examples using the CALCULATETABLE
=SUMX( CALCULATETABLE(‘InternetSales_USD’, ‘DateTime'[CalendarYear]=2006) , [SalesAmount_USD])
CALCULATETABLE(<table_expression>, table[column]=10)
= SUMX ( CALCULATETABLE (East_Sales, FILTER (East_Sales, East_Sales[Product]=[Product])), East_Sales[Sales Amount] )
Related Courses
Loading