CALCULATETABLE Function (DAX)

How does the CALCULATETABLE function (DAX) work?

The CALCULATETABLE function (DAX) evaluates a table expression in a context that is modified by the given filters. 

CALCULATETABLE Formula Syntax

CALCULATETABLE(
     <expression>, <filter1>, <filter2>,…
)

How do you use the CALCULATETABLE function?

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

Related Support Forum Posts

IF Condition with CALCULATE
Dax Calculation question
Calculation for Related Column in Calculated Column

Considerations when using the CALCULATETABLE function

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

Formula examples using the CALCULATETABLE function

=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 DAX Functions

FILTER Function (DAX)

Related Course Modules

Ultimate-Beginners-Guide-To-PowerBI

DOWNLOAD

To access our comprehensive DAX formula reference guide just insert your email address below. The resource will download immediately and we’ll also email it to you.