Short answer: filter context is the set of filters in force when a measure is calculated: the slicers, the row and column of the visual, and any filter CALCULATE adds. Row context is "the current row" while DAX walks a table, in a calculated column or an iterator like SUMX. Context transition is what CALCULATE does with a row context: it turns the current row into filters, so a measure inside an iterator is calculated for that row.
Almost every "why is my total wrong" in DAX comes down to which context a piece of the formula runs in.
Where does filter context come from?
- 1SlicerYear = 2026
- 2Matrix rowCustomer[Region] = "West"
- 3Matrix columnProduct[Category] = "Bikes"
- 4CALCULATEcan add, replace or remove filters
- 5MeasureSUM(Sales[Amount]) over the rows left
The same measure gives a different number in every cell because each cell has a different filter context, not because the formula changed.
Revenue = SUM ( Sales[Amount] )
Revenue all regions = CALCULATE ( [Revenue], REMOVEFILTERS ( Customer[Region] ) )
Share of region = DIVIDE ( [Revenue], [Revenue all regions] )What is context transition?
An iterator walks a table row by row. Inside it, a column reference reads the current row, but a measure is always evaluated in a filter context. So DAX wraps the measure in an invisible CALCULATE, which turns the current row into filters: that is context transition.
-- Average revenue per customer: [Revenue] runs once per customer
Avg revenue per customer =
AVERAGEX ( VALUES ( Customer[CustomerID] ), [Revenue] )
-- Without the measure there is no transition: this sums every sale for every customer
Wrong average =
AVERAGEX ( VALUES ( Customer[CustomerID] ), SUM ( Sales[Amount] ) )| Inside AVERAGEX | Filters per customer row | Result |
|---|---|---|
| [Revenue] (a measure) | yes, CustomerID = the current one | revenue of that customer |
| SUM(Sales[Amount]) | no | all revenue, for every customer |
| CALCULATE(SUM(Sales[Amount])) | yes | revenue of that customer |
What goes wrong?
- A measure inside a calculated column. Context transition fires for every row and filters by every column of that row. On a table with duplicate rows the result surprises; it is also slow on big tables.
- Iterating a large table with a measure inside. Each row is a new filter context. Iterate the smallest table that answers the question, like
VALUES(Customer[CustomerID]), notSales. - FILTER on a whole table where a column filter in CALCULATE would do.
CALCULATE([Revenue], Customer[Region] = "West")is clearer and faster.
Where can you check this?
- Microsoft Learn: CALCULATE function (DAX)
- Microsoft Learn: DAX overview: context
- SQLBI: Understanding context transition in DAX
Where do you start?
The open course DAX measures that add up has a lesson on exactly this: CALCULATE changes the filter, and a measure inside a row. Then Every KPI once puts it to work in a calculation group.