0
0
Power BIbi_tool~20 mins

RANKX for ranking in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
RANKX Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate rank of sales by product
Given a Sales table with columns Product and SalesAmount, what is the rank of Product 'B' using this measure?

Rank Sales = RANKX(ALL(Sales[Product]), SUM(Sales[SalesAmount]), , DESC, Dense)

Sales data:
Product A: 100
Product B: 200
Product C: 150
Power BI
Rank Sales = RANKX(ALL(Sales[Product]), SUM(Sales[SalesAmount]), , DESC, DENSE)
A3
B2
C1
DError
Attempts:
2 left
💡 Hint
Remember that DESC means highest value gets rank 1.
visualization
intermediate
1:30remaining
Best visualization for showing product ranks
You want to show product sales ranks on a dashboard. Which visualization best shows the rank order clearly?
ABar chart sorted by rank ascending
BPie chart showing sales amounts
CScatter plot with sales on X and product name on Y
DTable with product names only
Attempts:
2 left
💡 Hint
Think about which chart shows order clearly.
data_modeling
advanced
2:30remaining
Ranking with filters and context
You have a Sales table with Product, Region, and SalesAmount. You want to rank products by sales within each Region. Which DAX measure correctly calculates this?
ARank by Region = RANKX(ALL(Sales[Product]), CALCULATE(SUM(Sales[SalesAmount]), ALLEXCEPT(Sales, Sales[Region])), , DESC, DENSE)
BRank by Region = RANKX(ALL(Sales[Product], Sales[Region]), SUM(Sales[SalesAmount]), , DESC, DENSE)
CRank by Region = RANKX(ALLSELECTED(Sales[Product]), CALCULATE(SUM(Sales[SalesAmount])), , DESC, DENSE)
DRank by Region = RANKX(ALL(Sales[Product]), SUM(Sales[SalesAmount]), , DESC, DENSE)
Attempts:
2 left
💡 Hint
You want to keep Region filter but remove Product filter inside RANKX.
🔧 Formula Fix
advanced
2:00remaining
Identify error in RANKX measure
This DAX measure is intended to rank products by sales but returns an error:

Rank Sales = RANKX(Sales[Product], SUM(Sales[SalesAmount]))

What is the cause of the error?
Power BI
Rank Sales = RANKX(Sales[Product], SUM(Sales[SalesAmount]))
AMissing order argument DESC or ASC
BSUM cannot be used inside RANKX
CRANKX requires a filter argument
DRANKX expects a table as first argument, but Sales[Product] is a column, not a table
Attempts:
2 left
💡 Hint
Check the first argument type for RANKX.
🧠 Conceptual
expert
2:30remaining
Effect of ranking method on ties
You use RANKX with the Dense ranking method on sales data with ties. How does Dense ranking handle ties compared to Skip ranking?
ADense ranking skips ranks after ties, next rank increments by number of tied items
BDense ranking assigns the same rank to ties and next rank increments by 1
CDense ranking assigns unique ranks ignoring ties
DDense ranking always assigns rank 1 to all tied items
Attempts:
2 left
💡 Hint
Think about how ranks progress after ties in Dense vs Skip.