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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Rachid1679
Regular Visitor

Issue with RANKX with filters

Hello team

I need your support regarding the dax measure RANKX. When using the measure in a matrix i get the correct ranking by customer. However, when selecting a specific customer from a slicer or another visual, the ranking is wrong (for some customers). 

 

The DAX measure is :

RANKX(ALL('Table'[customer]),[Sales])

 

Enclosed a data simplified. 

ISSUE RANKX PB.PNG

Thank you for the support. 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi  @Rachid1679 ,

 

You can try the following dax

Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Sales])),,DESC)

vyangliumsft_0-1714703087294.png

 

Best Regards,

Liu Yang

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

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

I used these measures

S = SUM(Data[Sales])
Rank = RANK(DENSE,ALL(Data[Customer]),orderby([S],DESC))

Hope this helps.

Ashish_Mathur_0-1714706456362.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

I used these measures

S = SUM(Data[Sales])
Rank = RANK(DENSE,ALL(Data[Customer]),orderby([S],DESC))

Hope this helps.

Ashish_Mathur_0-1714706456362.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi  @Rachid1679 ,

 

You can try the following dax

Rank =
RANKX(ALL('Table'),CALCULATE(SUM('Table'[Sales])),,DESC)

vyangliumsft_0-1714703087294.png

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.