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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-yangliu-msft
Community Support
Community Support

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/
v-yangliu-msft
Community Support
Community Support

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.