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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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