Power BI Data Analyst PL-300 · Model the Data · medium

A Sales table has 3 order lines: Line 1 (Qty = 2, UnitPrice = 10), Line 2 (Qty = 5, UnitPrice = 20), and Line 3 (Qty = 3, UnitPrice = 30). You want a single DAX measure that computes total revenue (2*10 + 5*20 + 3*30 = 210) without adding a physical calculated column to the table. Which DAX expression is both syntactically valid and mathematically accurate?

Published · Last updated · checked before publication — how we verify questions

Options

  • ASUM(Sales[Qty] * Sales[UnitPrice]) producing 210 directly
  • BSUMX(Sales, Sales[Qty] * Sales[UnitPrice]) evaluating to 210Correct answer
  • CSUM(Sales[Qty]) * SUM(Sales[UnitPrice]) evaluating to 210
  • DCALCULATE(SUM(Sales[UnitPrice]), FILTER(Sales, Sales[Qty] > 0))

Answer: B. SUMX(Sales, Sales[Qty] * Sales[UnitPrice]) evaluating to 210

The iterator function SUMX(Sales, Sales[Qty] * Sales[UnitPrice]) establishes a row context over Sales, evaluates 2*10 = 20, 5*20 = 100, and 3*30 = 90 row by row, and sums them to 210. By contrast, SUM(Sales[Qty]) * SUM(Sales[UnitPrice]) computes (2+5+3) * (10+20+30) = 10 * 60 = 600 (wrong).

Why the other options are wrong

  • A. SUM(Sales[Qty] * Sales[UnitPrice]) producing 210 directly — DAX SUM() accepts only a single column reference, not a multi-column arithmetic expression.
  • C. SUM(Sales[Qty]) * SUM(Sales[UnitPrice]) evaluating to 210 — Multiplying the sums yields 10 * 60 = 600 rather than the row-by-row revenue sum of 210.
  • D. CALCULATE(SUM(Sales[UnitPrice]), FILTER(Sales, Sales[Qty] > 0)) — Summing only UnitPrice gives 10 + 20 + 30 = 60 and fails to multiply each unit price by its quantity.

All Model the Data questions and the topic overview →

Microsoft and Azure are trademarks of Microsoft Corporation. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Microsoft Corporation.