Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
chotu27
Post Patron
Post Patron

Don't Rank with Blank Field Value in column

Hi All,

 

I wanted to rank only for category which have names not for all.

 

Data:

CategorySales
Electronics556
Pharmacy88
Bakery999
 800

 

Expected Output:  

 

CategorySalesRank
Electronics5562
Pharmacy883
Bakery9991
 800 

 

DAX Measure Used (Rank) = 

RANKX(ALL('Table'[Category]), CALCULATE(SUM('Table'[Sales]), ALLEXCEPT('Table','Table'[Category])))
 
Can someone Help me to Rank only for the catgeory which has names.
 
 
Note: I don't want to use any filter in transform editor i wanted to see the blank names but not the rank

 

 

 

3 REPLIES 3
RasmusN532
Helper I
Helper I

I am having the same problem - did anyone find a solution to this ? 🙂

danextian
Super User
Super User

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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian 

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.