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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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