0
0
Power BIbi_tool~10 mins

RANKX for ranking in Power BI - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to rank sales by product using RANKX.

Power BI
Product Rank = RANKX(ALL('Products'), SUM('Sales'[[1]]))
Drag options to blanks, or click blank then click option'
AProfit
BSalesAmount
CDiscount
DQuantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using Quantity instead of SalesAmount will rank by units sold, not sales value.
Using Discount or Profit columns may not reflect total sales ranking.
2fill in blank
medium

Complete the code to rank customers by total sales in descending order.

Power BI
Customer Rank = RANKX(ALL('Customers'), CALCULATE(SUM('Sales'[SalesAmount])), , [1])
Drag options to blanks, or click blank then click option'
ADESC
BASC
CTOP
DBOTTOM
Attempts:
3 left
💡 Hint
Common Mistakes
Using ASC will rank from smallest to largest, which is not desired here.
TOP and BOTTOM are not valid order arguments in RANKX.
3fill in blank
hard

Fix the error in the ranking measure by completing the missing argument.

Power BI
Rank by Profit = RANKX(ALL('Products'), SUM('Sales'[Profit]), , , [1])
Drag options to blanks, or click blank then click option'
AStandard
BSkip
CUnique
DDense
Attempts:
3 left
💡 Hint
Common Mistakes
Using Skip ranking leaves gaps in rank numbers after ties.
Standard and Unique are not valid options for RANKX tie handling.
4fill in blank
hard

Fill both blanks to rank products by total sales, ignoring filters and ranking in ascending order.

Power BI
Product Rank = RANKX([1], SUM('Sales'[SalesAmount]), , [2])
Drag options to blanks, or click blank then click option'
AALL('Products')
BFILTER('Products', 'Products'[Category] = "Bikes")
CASC
DDESC
Attempts:
3 left
💡 Hint
Common Mistakes
Using FILTER limits ranking to a category, not all products.
Using DESC ranks from largest to smallest, not ascending.
5fill in blank
hard

Fill all three blanks to create a ranking measure that ranks customers by total sales, ignoring filters, ranking descending, and using dense ranking.

Power BI
Customer Rank = RANKX([1], CALCULATE(SUM('Sales'[SalesAmount])), , [2], [3])
Drag options to blanks, or click blank then click option'
AALL('Customers')
BDESC
CDense
DFILTER('Customers', 'Customers'[Region] = "West")
Attempts:
3 left
💡 Hint
Common Mistakes
Using FILTER limits ranking to a region, not all customers.
Using ASC ranks from smallest to largest, not descending.
Using Skip ranking leaves gaps in ranks after ties.