Forum Discussion
CREsearch
6 years agoFrequent Visitor
Return nth ranked value based on criteria
In the below dataset I have a column that ranks the order/position of a value within a grouping. I'm trying to find a dax function that will allow me to return the nth largest value based within a gi...
Icey
Community Support
6 years agoHi CREsearch ,
If so, just try this:
Create a measure:
SwapRank =
RANKX (
ALLEXCEPT ( 'Table', 'Table'[Address] ),
CALCULATE ( MAX ( 'Table'[Rank] ) ),
,
DESC,
DENSE
)
Best Regards
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
CREsearch
6 years agoFrequent Visitor
I'm getting a circular dependency error for some reason. Note that it has to be a custom column I believe and not a measure as I need to use it for an axis in a bar chart.
- Icey6 years ago
Community Support
Hi CREsearch ,
Try this:
SwapRank 2 = RANKX ( FILTER ( 'Table', 'Table'[Address] = EARLIER ( 'Table'[Address] ) ), 'Table'[Rank], , DESC, DENSE )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- CREsearch6 years agoFrequent Visitor
Yes, works like a charm! Thank you!
- Ashish_Mathur6 years ago
Super User
Hi,
If my reply helped, please mark it as Answer.