Forum Discussion
Rank based on aggregate
- 8 years ago
Thanks Matt,
I tried that and it didn't work. I've only just started learning DAX, but I thought that using VALUES would have then given me only the distinct values regardless?
I tried another workaround which seems to work (I've used 2 measures purely to split the code):
Measure Amount = CALCULATE(
SUM('Sample'[Sales_Amount]),
ALLSELECTED('Sample'[Month_Key])
)Rank = RANKX (
FILTER(ALLSELECTED('Sample'[Product]), [Measure Amount] <> 0),
[Measure Amount]
)Thanks again for your help with this
Hi cs_rob,
I 'd like to suggest you take a look at marco's blog which also told about how to use rankx fucntion with a measure:
Use of RANKX in Power BI measures
Regards,
Xiaoxin Sheng
Thanks for sharing this article Xiaoxin,
This definitely enhanced my knowledge a bit and made me wary of the potential pitfalls.
Kind regards,
cs_rob