Forum Discussion

mp390988's avatar
mp390988
Icon for Post Partisan rankPost Partisan
3 years ago
Solved

SUMX with CALCULATETABLE inside

Hello,   I understand context transition happens when we have calculate/calculatetable or a named measure inside an interator. For example, if I create a calculated column and enter this formula =C...
  • johnt75's avatar
    3 years ago

    CALCULATETABLE is forcing context transition, so the current row essentially becomes the filter context. The filters on Freight and Ship Via then get merged into that context, so you are only seeing values for rows which match the Freight and Ship Via conditions. It is equivalent to writing

    calculated column =
    IF ( Orders[Freight] > 100 && Orders[ShipVia] = 3, Orders[Freight] )