Skip to main content
Albero Academy

Aggregation & Iterators

SUM vs SUMX — plain aggregates and row-by-row iterators.

DAX8 min

DAX has two families of aggregation: plain aggregators like SUM that work on a single column, and iterators (the X functions) that evaluate an expression row by row, then aggregate.

The X functions

SUM vs SUMX
-- Plain: sums an existing column
Total = SUM(Sales[Amount])
-- Iterator: computes a value per row, then sums
Revenue = SUMX(Sales, Sales[Qty] * Sales[Price])
│ │ └ expression evaluated for EACH row
│ └ the table to iterate
└ then sum the results

Every aggregator has an X twin: SUMX, AVERAGEX, COUNTX, MAXX. Use the X version when the value you need doesn't already exist as a column but must be computed per row (like quantity × price).

Key takeaways

  1. 01Plain aggregators (SUM, AVERAGE) work on one existing column.
  2. 02Iterators (SUMX, AVERAGEX…) evaluate an expression per row, then aggregate.
  3. 03Use an X function when the value must be computed per row (e.g. qty × price).
  4. 04Iterators avoid needing an extra calculated column, keeping the model lean.

Finished this chapter?

Mark it complete to track your progress through Power BI.