cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nantes44100 Regular Visitor
Regular Visitor

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

Accepted Solutions
Super User III
Super User III

Re: RANKX on a DISTINCTCOUNT ?

@Nantes44100 

 

Try Following

 

RANK =
RANKX ( ALLSELECTED ( TableName[Client] ), [#HOW_MANY_PROJECTS],, DESC, DENSE )
Try my new Power BI game Cross the River

View solution in original post

2 REPLIES 2
Super User III
Super User III

Re: RANKX on a DISTINCTCOUNT ?

@Nantes44100 

 

Try Following

 

RANK =
RANKX ( ALLSELECTED ( TableName[Client] ), [#HOW_MANY_PROJECTS],, DESC, DENSE )
Try my new Power BI game Cross the River

View solution in original post

Nantes44100 Regular Visitor
Regular Visitor

Re: RANKX on a DISTINCTCOUNT ?

Thank you @Zubair_Muhammad ! 

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors