# When should I use SUMX instead of SUM in a Power BI measure?

Exam: DP-600 — Implementing Analytics Solutions Using Microsoft Fabric
Knowledge domain: Implement and manage semantic models (25–30%)
Updated: 2026-11-19T05:35:28.107223+00:00
HTML: https://learningpathx.com/faq/DP-600/dp600-dax-sum-versus-sumx.html

## Also asked as

- When does a DAX calculation require an iterator rather than a simple sum?
- How do I choose SUM or SUMX for row-dependent revenue?

Use SUM when a validated column already contains the additive value you need. Use SUMX when the required expression depends on values from each row of a table and must then be aggregated.

For an order-line Sales table with Quantity and NetUnitPrice columns:

```dax
Extended Revenue =
SUMX ( Sales, Sales[Quantity] * Sales[NetUnitPrice] )
```

Each line's quantity is multiplied by its own price before summing. Multiplying total quantity by total price doesn't express that business rule. If an accurate line-level Revenue column already exists, `SUM ( Sales[Revenue] )` is simpler.

Choose the iterator's table at the intended business grain. Iterating every transaction is different from iterating customers or months, even if the expressions look similar. Filter the input deliberately and avoid generating an unnecessarily large intermediate table.

Check a single row, multiple prices, filters, empty data, and totals against known arithmetic. Then measure performance with the actual visual: the presence of an iterator alone doesn't identify a bottleneck.

[SUMX reference](https://learn.microsoft.com/en-us/dax/sumx-function-dax).

Source: [DP-600: Advanced DAX Patterns for Enterprise Semantic Models](https://learningpathx.com/news/dp-600-advanced-dax-patterns-for-enterprise-semantic-models.html)
