0
0
Power BIbi_tool~8 mins

RANKX for ranking in Power BI - Dashboard Guide

Choose your learning style9 modes available
Dashboard Mode - RANKX for ranking
Business Question

Which products have the highest sales and how do they rank compared to others?

Sample Data
Product Category Sales
AlphaElectronics300
BetaElectronics450
GammaFurniture200
DeltaFurniture500
EpsilonOffice Supplies150
ZetaOffice Supplies400
Dashboard Components
  • KPI Card: Total Sales
    Formula: Total Sales = SUM(Sales[Sales])
    Result: 2000
  • Table: Product Sales with Rank
    Columns: Product, Category, Sales, Sales Rank
    Rank Formula:
    Sales Rank = RANKX(ALL(Sales[Product]), CALCULATE(SUM(Sales[Sales])), , DESC, DENSE)
    Shows each product's sales and its rank from highest to lowest sales.
  • Bar Chart: Sales by Product
    X-axis: Product
    Y-axis: Sales
    Sorted by Sales Rank descending
Dashboard Layout
+----------------------+-------------------------+
|      Total Sales      |   Sales by Product      |
|       (KPI Card)      |       (Bar Chart)       |
+----------------------+-------------------------+
|        Product Sales with Rank Table               |
+----------------------------------------------------+
    
Interactivity

Applying a filter on Category updates all components:

  • Total Sales recalculates sum only for selected category.
  • Product Sales with Rank Table shows only products in the selected category with updated ranks.
  • Sales by Product Bar Chart displays bars only for filtered products, sorted by updated rank.
Self Check

If you add a filter for Category = Electronics, which products remain and what are their ranks?

Answer: Products Alpha and Beta remain.
Sales: Alpha = 300, Beta = 450.
Ranks: Beta is 1, Alpha is 2.

Key Result
Dashboard showing product sales, total sales, and ranking of products by sales using RANKX.