0
0
Power BIbi_tool~20 mins

SUMX and iterators in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SUMX Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate total sales with SUMX iterator

Given a table Sales with columns Quantity and UnitPrice, what is the result of this DAX measure?

Measure = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])

Assume the table has these rows:

  • Quantity: 2, UnitPrice: 10
  • Quantity: 3, UnitPrice: 15
  • Quantity: 1, UnitPrice: 20
Power BI
Measure = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])
A30
B45
C85
D50
Attempts:
2 left
💡 Hint

Multiply quantity by unit price for each row, then add all results.

visualization
intermediate
1:30remaining
Best visualization for SUMX sales by category

You have a measure using SUMX to calculate total sales per product category. Which visualization best shows the sales distribution across categories?

APie chart showing sales percentage per category
BLine chart showing sales over time
CScatter plot of sales vs. quantity
DTable listing product names and sales
Attempts:
2 left
💡 Hint

Think about showing parts of a whole for categories.

🔧 Formula Fix
advanced
2:00remaining
Identify error in SUMX measure with filter

What error occurs with this DAX measure?

Measure = SUMX(FILTER(Sales, Sales[Quantity] > 2), Sales[Quantity] * Sales[UnitPrice])

Assume Sales table has rows with Quantity values 1, 2, 3.

Power BI
Measure = SUMX(FILTER(Sales, Sales[Quantity] > 2), Sales[Quantity] * Sales[UnitPrice])
AReturns the sum of Quantity * UnitPrice for rows where Quantity > 2
BReturns 0 because no rows match the filter
CSyntax error due to incorrect FILTER usage
DRuntime error because Sales table is not referenced correctly
Attempts:
2 left
💡 Hint

FILTER returns rows where Quantity is greater than 2.

data_modeling
advanced
2:30remaining
Using SUMX with related tables

You have two tables: Orders with columns OrderID, CustomerID, and Quantity, and Products with columns ProductID, CustomerID, and UnitPrice. You want to calculate total sales per customer using SUMX. Which DAX measure correctly calculates this?

ATotal Sales = SUMX(Orders, Orders[Quantity] + RELATED(Products[UnitPrice]))
BTotal Sales = SUMX(Orders, Orders[Quantity] * RELATED(Products[UnitPrice]))
CTotal Sales = SUMX(Orders, Orders[Quantity] * Products[UnitPrice])
DTotal Sales = SUMX(Products, Products[UnitPrice] * RELATED(Orders[Quantity]))
Attempts:
2 left
💡 Hint

Use RELATED to get unit price from Products for each order row.

🧠 Conceptual
expert
3:00remaining
Why use SUMX instead of SUM for calculated columns?

Which statement best explains why SUMX is preferred over SUM when calculating total sales as Quantity * UnitPrice?

ASUM automatically multiplies columns before summing, SUMX does not.
BSUMX is faster than SUM because it uses iterators internally.
CSUMX can only be used with calculated columns, SUM cannot.
DSUMX iterates row by row allowing multiplication before summing, while SUM only sums a single column without calculation.
Attempts:
2 left
💡 Hint

Think about how calculations happen per row.