Power BI Exercises

Rank the menu

Advanced DAX · Intermediate · Chapter 9 of 10. Variables, ranking, iterators and dynamic labels.

The request, from Owen Price, Founder, Copperbean Coffee: "Rank our menu by revenue. I'm thinking of dropping the bottom two." A measure named Drink Rank.

RANKX(ALL(Drink[Drink]), [Total Revenue]) ranks every drink by revenue. ALL is essential: without it, each row would only be ranked against itself and get rank 1.

Task: Create Drink Rank = RANKX(ALL(Drink[Drink]), [Total Revenue]).

Practice data: Copperbean Coffee, a fictional chain of coffee shops. The model has the Orders, Drink and Store tables.

DAX functions used: RANKX, ALL.

How it works: the exercise opens a practice copy of the Power BI report editor in your browser. Do the task, press Check, and your result is compared with the expected answer in seconds. Hints are there if you get stuck.

Keep practicing