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
danialsj
Frequent Visitor

Ranking data with certain filters

I have data that I want to rank with filters within the DAX formula. I need a DAX formula which lets me rank 'Branches' in the 'North' cluster for the month of 'October'.


Data Preview:
Branch     Score       Month     Cluster
1001         70             Sept       North
1002         76             Sept       South
1003         77             Sept       North
1004         72             Sept       North

1005         56             Sept       South
1001         74             Oct        North
1002         73             Oct        South
1003         78             Oct        North
1004         69             Oct        North
1005         54             Oct        South

Required:
Ranking of Branches of North cluster for October
1      1003      78
2      1001      74
3      1004      69


Please help!

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @danialsj ,

You can create your measure like so:

 

Rank = 
RANKX (
    ALLSELECTED(  'Table' ),
    CALCULATE ( MAX ( 'Table'[Score] ) ),
    ,
    DESC,
    DENSE
)

 

 ranrank.PNG

 

Best Regards,
Icey

 

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

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

These are the measures I used

Scores = SUM(Data[Score])
Measure = RANKX(ALLSELECTED(Data[Branch]),[Scores])
Hope this helps.
Untitled.png

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

Hi @danialsj ,

You can create your measure like so:

 

Rank = 
RANKX (
    ALLSELECTED(  'Table' ),
    CALCULATE ( MAX ( 'Table'[Score] ) ),
    ,
    DESC,
    DENSE
)

 

 ranrank.PNG

 

Best Regards,
Icey

 

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

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.

Top Solution Authors