Data Dictionary

Context transition

What is context transition?

Context transition is what happens when CALCULATE turns the current row context into an equivalent filter context. In plain terms: DAX takes the row it is standing on, says "filter the model down to this exact row", and then runs the calculation inside that filter.

It is the reason a measure behaves differently when you drop it inside an iterator, and it is one of the parts of DAX that most rewards a clear mental picture. It builds straight on the two evaluation contexts, filter context and row context, so it helps to be comfortable with those first.

How CALCULATE triggers it

CALCULATE has a documented side effect: before it applies any filters you pass it, it converts any row context into filter context. Microsoft's reference puts it plainly, that CALCULATE used without filters transitions row context to filter context.

Here is the classic case. In a Customer table calculated column you have a row context, one customer per row, but no filter context. A bare sum would return the sales of every customer, repeated on each row. Wrap it in CALCULATE and the current customer row becomes a filter.

Customer Sales =
CALCULATE ( SUM ( Sales[Amount] ) )

Now each row returns that one customer's sales instead of the grand total. CALCULATE read the current row, converted it into a filter on the customer, and the sum respected it.

Why a measure inside an iterator behaves differently

Every measure carries an invisible CALCULATE around it. So the moment you reference a measure inside an iterator such as SUMX, context transition happens automatically on each row of the loop.

Total = SUMX ( Customers, [Customer Sales] )

For each customer row, the measure's built-in CALCULATE transitions that row into a filter, so [Customer Sales] returns that single customer's total, and SUMX adds those totals together. Write the same idea with a plain column expression and no measure, and you often get a different answer, because nothing triggers the transition and the inner sum sees the whole table.

This automatic transition is both convenient and easy to trip over. It is convenient because a well-written measure just works when you reuse it inside another calculation. It trips people up when they do not realise a transition is happening and cannot explain why the number changed.

Context transition and calculation groups

A calculation group applies one expression across many measures, and those expressions run through CALCULATE. That means context transition is part of how a calculation group reshapes each measure it touches. If you build time-intelligence or currency variants as a calculation group, the same rules about turning rows into filters still apply, which is one more reason the concept is worth owning rather than memorising case by case.

What to watch out for with context transition

  • It can be expensive. A transition on every row of a large table, for example a measure inside an iterator over millions of rows, does real work each time. If a measure feels slow, check whether it is transitioning context row by row and iterate a smaller table where you can.

  • Non-unique rows filter more than you expect. Context transition filters to every row that matches the current one across all its columns. If the table you are iterating has duplicates on the columns that matter, the transition includes all of them, rather than the single row you pictured. Give the table a unique key.

  • Measures in calculated columns. Referencing a measure in a calculated column transitions the current row to a filter automatically. That is sometimes what you want and sometimes a surprise, so be deliberate about it.

Last Updated: July 17, 2026 Back to Dictionary
Keywords
context transition CALCULATE DAX filter context and row context row context filter context calculation group measure Power BI business intelligence