CALCULATE Function (DAX)

How does the CALCULATE function (DAX) work?

Evaluates an expression in a context that is modified by the specified filters.

CALCULATE Formula Syntax

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

How do you use the CALCULATE function?

The CALCULATE function changes the context in which the data is filtered, and evaluates the expression in the new context that you specify. For each column used in a filter argument, any existing filters on that column are removed, and the filter used in the filter argument is applied instead.

Related Blog Posts

Related Support Forum Posts

Understanding DAX Formula
Developing Complex Dax functions

Considerations when using the CALCULATE function

When a filter argument has the form of a predicate with a single column reference, the expression is embedded into a FILTER expression that filters all the values of the referenced column. 

Related Video Tutorials

Formula examples using the CALCULATE function

=( SUM(‘ResellerSales_USD'[SalesAmount_USD])) /CALCULATE( SUM(‘ResellerSales_USD'[SalesAmount_USD]) ,ALL(‘ResellerSales_USD’))

CALCULATE(AVERAGE(Website[Sessions]),Website[type]=”Organic Search”, Website[gender]=’female’)

CALCULATE(SUM(Website[Sessions],YEAR(Website[date)-1)

Related DAX Functions

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.