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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

RANKX on a DISTINCTCOUNT ?

Hello everyone,

 

am I the only one getting mad with the RANKX function ? each time I have to use it, I struggle so hard :((

I've seen many posts on the Internet but I can't figure it out.

 

what I want is simple, a rank of the clients by the number of projects. (housing building projects....clients names substituted by bands names :))

 

I always have '1' Smiley Frustrated

AZERT.PNG

#HOW_MANY_PROJECTS = DISTINCTCOUNT(Table2[ID_PROJECT])
#HOW_MANY_FLATS = SUMX(
SUMMARIZE(Table2;Table2[ID_PROJECT];Table2[HOW_MANY_FLATS]);Table2[HOW_MANY_FLATS])

 

I've tried different combination of formulas for RANKX

RANK = RANKX(Table2;
    CALCULATE([#HOW_MANY_PROJECTS]);;DESC;Dense)

how to get a proper rank please ?

 

many thanks !

 

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try Following

 

RANK =
RANKX ( ALLSELECTED ( TableName[Client] ), [#HOW_MANY_PROJECTS],, DESC, DENSE )

Regards
Zubair

Please try my custom visuals

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try Following

 

RANK =
RANKX ( ALLSELECTED ( TableName[Client] ), [#HOW_MANY_PROJECTS],, DESC, DENSE )

Regards
Zubair

Please try my custom visuals
Anonymous
Not applicable

Thank you @Zubair_Muhammad ! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.