cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Super User

Re: RANKX on a DISTINCTCOUNT ?

@Nantes44100 

 

Try Following

 

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

View solution in original post

2 REPLIES 2
Super User
Super User

Re: RANKX on a DISTINCTCOUNT ?

@Nantes44100 

 

Try Following

 

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

View solution in original post

Nantes44100 Regular Visitor
Regular Visitor

Re: RANKX on a DISTINCTCOUNT ?

Thank you @Zubair_Muhammad ! 

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 286 members 2,676 guests
Please welcome our newest community members: