๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Power BI & Business Analysis Module 4 ยท Lesson 10 of 15

0% Exit to course

Module 4 ยท DAX for harder questions Lesson 10 of 15

Ranking and TOPN

Learning objective

Ranking answers "which products are in the top ten" without sorting a table by hand. RANKX does it as a measure, and TOPN returns just the rows that matter.

Worked example

RANKX(ALL(dim_product[product]), [Total Sales]) numbers every product by sales, so a table filtered to rank <= 10 shows the top ten.

Your practice task

Build a measure that ranks products by sales and show only the top five on a visual.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

Ranking answers "which products are in the top ten" without sorting a table by hand. RANKX does it as a measure, and TOPN returns just the rows that matter.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.

Next recommended course Data Analytics with SQL & Excel