Challenge - 5 Problems
TOPN Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ dax_lod_result
intermediate2:00remaining
Understanding TOPN with a single column
Given a Sales table with columns Product and SalesAmount, what does the following DAX expression return?
Choose the correct description of the output.
TOPN(3, Sales, Sales[SalesAmount], DESC)Choose the correct description of the output.
Power BI
TOPN(3, Sales, Sales[SalesAmount], DESC)Attempts:
2 left
💡 Hint
TOPN returns a specified number of rows ordered by a column.
✗ Incorrect
TOPN(3, Sales, Sales[SalesAmount], DESC) returns the top 3 rows sorted by SalesAmount in descending order, so the highest sales come first.
❓ visualization
intermediate2:00remaining
Visualizing TOPN results in a report
You want to create a bar chart in Power BI that shows the top 5 products by total sales. Which DAX measure would correctly filter the products to show only the top 5 in the chart?
Attempts:
2 left
💡 Hint
Use TOPN with VALUES to get distinct products ordered by total sales.
✗ Incorrect
Option D correctly uses TOPN to get the top 5 products by total sales amount. It uses VALUES to get distinct products and orders them by the sum of sales in descending order.
❓ data_modeling
advanced2:00remaining
Using TOPN with multiple sort columns
You have a Sales table with columns Product, Region, and SalesAmount. You want to get the top 3 sales rows ordered first by Region ascending, then by SalesAmount descending. Which DAX expression achieves this?
Attempts:
2 left
💡 Hint
The order of columns and their sort directions matter in TOPN.
✗ Incorrect
Option B correctly orders by Region ascending first, then SalesAmount descending, matching the requirement.
🔧 Formula Fix
advanced2:00remaining
Identify the error in this TOPN usage
What error will the following DAX expression cause?
Assuming Sales[SalesAmount] is numeric.
TOPN(5, Sales, Sales[SalesAmount])Assuming Sales[SalesAmount] is numeric.
Power BI
TOPN(5, Sales, Sales[SalesAmount])Attempts:
2 left
💡 Hint
TOPN requires explicit sort order for each sort column.
✗ Incorrect
TOPN requires a sort order (ASC or DESC) for each sort column. Omitting it causes a syntax error.
🧠 Conceptual
expert3:00remaining
Scenario: Combining TOPN with CALCULATE and FILTER
You want to create a measure that calculates total sales for the top 3 products by sales amount, but only for the current year. Which DAX expression correctly achieves this?
Attempts:
2 left
💡 Hint
Use FILTER with ALL on Product and include the year filter inside FILTER.
✗ Incorrect
Option C correctly filters all products to top 3 by sales, and applies the year filter inside the FILTER function to limit rows to current year before summing sales.