Skip to main content

What is the difference between the CALCULATE and CALCULATETABLE functions in DAX/Power BI?

Table of Contents

The major difference between CALCULATE and CALCULATETABLE in Power BI is that the former returns a scalar result, which is to say that it evaluates the passed scalar value expression, be it a number or text, under the modified filter context. In other words, it will evaluate with those filters applied, including complex filtering logic through functions like FILTER. CALCULATE will always return, based on the modified context, a single scalar value.

On the other hand, CALCULATETABLE reevaluates the filter context against the input expression, expecting a table as a result and returning such a complete table of results—for example, a list of rows (customers or products). Similarly to CALCULATE, complex filters using functions like FILTER may be used with CALCULATETABLE, but these will return an entire table and not just a single value.

In other words, while being evaluated under the same changed filter context, CALCULATETABLE returns a table, whereas CALCULATE returns a scalar value.

FeatureCALCULATECALCULATETABLE
Return TypeScalar value (e.g., number, text)Table (e.g., list of rows like customers or products)
PurposeModify filter context and return a single valueModify filter context and return a table of rows
Expression TypeExpression that returns a scalar valueExpression that returns a table
Common Use CaseCalculating aggregations or metrics (e.g., SUM, AVERAGE)Generating a filtered list of rows (e.g., filtered customers)
ExampleCALCULATE(SUM(Sales[Amount]), Sales[Region] = "West")CALCULATETABLE(Products, Products[Category] = "Electronics")
FiltersCan apply multiple filters, including complex onesCan apply multiple filters, including complex ones

Add comment