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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.