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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
amani1980
Frequent Visitor

Rank based on measure

Hello,

 

I have an issue with my PBI model where I'm trying to rank people based on a measure. I have calculated rank using RANK function. However, rankings do not change when I toggle between years using a slicer. It always shows the same rank (which is computed for all years) regardless of which year I select in the slicer. PBI Model here.

 

amani1980_0-1734742225306.png

 

Can someone help me how to dyanmically rank based on a measure?

 

Thanks in advance,

AM

1 ACCEPTED SOLUTION
amani1980
Frequent Visitor

Thanks for the replies!

 

I was fumbling with RANKX for nearly a day and then stumbled upon RANK by accident (here in this forum) and it worked by accident and I didn't even realize it.

 

Rank Measure = RANK(DENSE,ALL(Names),ORDERBY([Measure],DESC),,)

 

Appreciate your time! 

View solution in original post

6 REPLIES 6
amani1980
Frequent Visitor

Thanks for the replies!

 

I was fumbling with RANKX for nearly a day and then stumbled upon RANK by accident (here in this forum) and it worked by accident and I didn't even realize it.

 

Rank Measure = RANK(DENSE,ALL(Names),ORDERBY([Measure],DESC),,)

 

Appreciate your time! 

Anonymous
Not applicable

Hi @amani1980 ,

Please mark your answer as a solution.

 

Best Regards

ribisht17
Super User
Super User

HI @amani1980 

Are you sure ?

 

It works as expected,

ribisht17_0-1734789651128.png

 

Here is my video on Power BI rank function https://youtu.be/IlB3Ezlrmro 

 

Regards,

Ritesh

ribisht17_1-1734789714576.pngPlease mark the answer if it is helpful so that it can help others as well
Bibiano_Geraldo
Super User
Super User

Hi @amani1980 ,

Based on your .pbix, your measure is working perfectly, as you can see in your table, when change the selection in the slicer the names are rearranged based on your Rank measure.

Ritaf1983
Super User
Super User

Hi @amani1980 
It seems that the formula works as expected....

Ritaf1983_0-1734758980166.png

The pbix with the simulation is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
lbendlin
Super User
Super User

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors