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
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.
More Model the Data questions
- To compute each product category's share of grand-total revenue ([% of All Category Sales]) in a matrix visual sliced…
- Performance Analyzer shows that a report page takes 6.4 seconds to render, and your .pbix file size has ballooned to…
- Why does Microsoft recommend designing a Star Schema (normalized dimension tables connected via 1:* single-direction…
- You are configuring a custom DimDate table in Power BI Desktop and selecting Mark as date table so DAX Time…
- When should a Power BI data modeler create a DAX Calculated Column instead of a DAX Measure?
- Your semantic model contains FactBudget (at the Month and Category grain) and FactActuals (at the daily Date and…
Microsoft and Azure are trademarks of Microsoft Corporation. PrepIQ Hub is not affiliated with, endorsed by, or sponsored by Microsoft Corporation.