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
Anonymous
Not applicable

RANKX

Hello,

 

I have tried many solutions posted on this forum but with no success :(( I hope someone can help me with this case:

 

I have a data set which looks likes this: 

Dataset Rankx.PNG

 

The clientnr contains unique numbers and the category level 1 and 2 are not unique and contain blank cells. I want to make a ranking based on the number of clients in category level 2 and make a table which looks like this:

Rankx final.PNG

 

I hope someone can post the right dax formula to solve this.

 

Thanks!!

 

Kind regards 

Tiemen

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

hi @Anonymous

 

Put in a matrix the columns of your table in this way:

 

step1.png

 

Then create a measure to Rank this:

 

Ranking =
RANKX (
    ALLEXCEPT ( Table1, Table1[category level 1] ),
    CALCULATE ( SUM ( Table1[clientnr] ) ),
    ,
    DESC
)

 

Steo2.png 




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

hi @Anonymous

 

Put in a matrix the columns of your table in this way:

 

step1.png

 

Then create a measure to Rank this:

 

Ranking =
RANKX (
    ALLEXCEPT ( Table1, Table1[category level 1] ),
    CALCULATE ( SUM ( Table1[clientnr] ) ),
    ,
    DESC
)

 

Steo2.png 




Lima - Peru
Anonymous
Not applicable

Thanx @Vvelarde! Your solution works perfect 🙂

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.