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: monthly rank on dupplicated values(Help)

I am trying to get top rank to get my top 3 of both cordinators and officers for each month.

RANKX(ALLSELECTED(mytable),CALCULATE(SUMX(SUMMARIZE(mytable,mytable[cordinator],mytable[officers],mytable[cordinator]))

 
CordinatorOfficers month

Value

SandraAndy1100
SandraAndy2150
SandraSam1100
SandraSam2110
PeterJulie1300
Abbyliam1200
AbbyLiam2150

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Here is a way of doing it:

1) I've created a model based on your data, including lookup tables which I use in both the measures and the visuals:

Model.JPG

 

2) The measures (note that the column references are to the lookup tables; I also use this column in the actual measure)

 

Rank Coordinator = 
VAR calc = RANKX(ALLSELECTED(Coordinator[Cordinator]); 
            [Sum of values]; ;DESC;Dense)
RETURN
IF(ISINSCOPE(Coordinator[Cordinator]); calc; BLANK())
Rank Officers = 
VAR calc = RANKX(ALLSELECTED(Officers[Officers]); 
            [Sum of values]; ;DESC;Dense)
RETURN
IF(ISINSCOPE(Officers[Officers]); calc; BLANK())

 

 

And here is the result:

results.JPG

 

You can use the filter pane to filter out blanks and to limit the rank to top "n"





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

@Anonymous 

 

Here is a way of doing it:

1) I've created a model based on your data, including lookup tables which I use in both the measures and the visuals:

Model.JPG

 

2) The measures (note that the column references are to the lookup tables; I also use this column in the actual measure)

 

Rank Coordinator = 
VAR calc = RANKX(ALLSELECTED(Coordinator[Cordinator]); 
            [Sum of values]; ;DESC;Dense)
RETURN
IF(ISINSCOPE(Coordinator[Cordinator]); calc; BLANK())
Rank Officers = 
VAR calc = RANKX(ALLSELECTED(Officers[Officers]); 
            [Sum of values]; ;DESC;Dense)
RETURN
IF(ISINSCOPE(Officers[Officers]); calc; BLANK())

 

 

And here is the result:

results.JPG

 

You can use the filter pane to filter out blanks and to limit the rank to top "n"





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






amitchandak
Super User
Super User

Do you want to combine ranking? Can you explain in details?

 

For Rank Refer these links
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
https://radacad.com/how-to-use-rankx-in-dax-part-1-of-3-calculated-columns
https://radacad.com/how-to-use-rankx-in-dax-part-3-of-3-the-finale

 

Top 3 inside each category

https://www.sqlbi.com/articles/filtering-the-top-3-products-for-each-category-in-power-bi/

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

 

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.