A DAX function that computes an expression after changing the filter context with filter modifiers, Boolean filters or table filters. Called with no filters, it still turns any row context into filter context, which is known as context transition.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains CALCULATE in context, with comparison tables and the common traps.
Terms in this definition
- DAX
Short for Data Analysis Expressions, the formula language you write measures, calculated columns and row-level security rules in, within tabular semantic models in Power BI, Excel Power Pivot or Analysis Services.
- Filter context
Whenever DAX evaluates an expression, each column is limited to certain values by slicers, report filters, a visual's rows and columns, relationships and any filters coded in formulas. Measures always calculate under these limits; row context, by contrast, means the current row.
- FILTER
Returns just those rows of a table that meet a condition. In CALCULATE it handles conditions too complex for a Boolean filter argument, though a Boolean filter is faster whenever one will work.
- Event
Table in Log Analytics where entries from Windows event logs are kept.
- Row context
Exists automatically in calculated columns and inside iterators like SUMX, giving DAX a current row to work on. Filtering the model is left to filter context; a current row does not do that by itself.
- context transition
What CALCULATE does to row context: it converts it into an equivalent filter context. You need it for aggregating expressions inside iterators or calculated columns, and referring to a model measure triggers it implicitly.
Related terms
- ALL
A DAX function that ignores any filters and gives back every row of a table or every value of the named columns. Used within CALCULATE, it works as a modifier that clears filters, although REMOVEFILTERS states that intent more clearly where it is available.
- Boolean filter expression
A true/false condition such as
'Product'[Color] = "Blue"passed as a filter to CALCULATE or CALCULATETABLE. Only one table's columns may appear in it, measures and nested CALCULATE calls are not allowed, and it overrides an existing filter on that column unless you wrap it in KEEPFILTERS. - CALCULATETABLE
Works like CALCULATE but returns a table: a table expression is evaluated under a modified filter context, with filter arguments behaving exactly as they do for CALCULATE.
- CROSSFILTER
Overrides a relationship's filter direction for one calculation only, choosing None, Both or OneWay. This DAX filter modifier goes inside CALCULATE and leaves the model's setting unchanged elsewhere.
- Filter modifier functions
Rather than adding a filter, these DAX functions change the existing filter context when passed to CALCULATE or CALCULATETABLE. The group covers REMOVEFILTERS, ALL and its variants, KEEPFILTERS, USERELATIONSHIP and CROSSFILTER.
- Intune data collection policy
The first time someone sets up Endpoint analytics, Intune automatically makes this Windows health monitoring profile and deploys it, so that devices start sending the information used to calculate the analytics scores.
- KEEPFILTERS
Wrapping a CALCULATE or CALCULATETABLE filter argument in this DAX modifier stops it overriding filters already on those columns; instead only values satisfying both survive.
- PREVIOUSMONTH
A DAX time intelligence function giving every date of the month that comes before the earliest date in the current context; it usually sits inside CALCULATE to build last-month measures.