Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I wanted to rank only for category which have names not for all.
Data:
| Category | Sales |
| Electronics | 556 |
| Pharmacy | 88 |
| Bakery | 999 |
| 800 |
Expected Output:
| Category | Sales | Rank |
| Electronics | 556 | 2 |
| Pharmacy | 88 | 3 |
| Bakery | 999 | 1 |
| 800 |
DAX Measure Used (Rank) =
I am having the same problem - did anyone find a solution to this ? 🙂
Hi @chotu27 ,
You can add another argument in your CALCULATE to exclude category items that are blank (assuming they're indeed blank/null). Try this:
DAX Measure Used (Rank) =
RANKX (
ALL ( 'Table'[Category] ),
CALCULATE (
SUM ( 'Table'[Sales] ),
ALLEXCEPT ( 'Table', 'Table'[Category] ),
FILTER ( 'Table', 'Table'[Category] <> BLANK () )
)
)
Alternatively, you can open go to: filter pane > visual filter tile > category > advanced filter > is not blank.
I'm getting all 1's when i use your measure for ranking,
and visual level filter will remove blank fields but it will rank blank field also i wanted exclude blanks while ranking
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |