Forum Discussion
JamesBurke
Helper III
2 years agoRank x
Hi , I'm struggling with a rankx Dax calculation that would rank all deivces assoicated with a specific stores name , Imagine i have 30 stores with hundreds of devices But i only want to ra...
Greg_Deckler
Community Champion
2 years agoJamesBurke So like this?
Rank = RANKX( FILTER( ALL('Table'), LEFT([Device],2) = "KP" ), CALCULATE(SUM([Usages])),, DESC )JamesBurke
Helper III
2 years ago
Rank =
RANKX(
FILTER( ALL('Emporia Devices'),
LEFT('Emporia Devices'[Device Name],2) = "KP" ),
CALCULATE(SUM('Emporia Device Usage'[Usages KWH])),, DESC )
This does not filter the device names to only rank KP Stores, it ranks all and not by Usages for some reason.
- Greg_Deckler2 years ago
Community Champion
JamesBurke How about this?
Rank = IF( LEFT('Emporia Devices'[Device Name],2) = "KP", RANKX( FILTER( ALL('Emporia Devices'), LEFT('Emporia Devices'[Device Name],2) = "KP" ), CALCULATE(SUM('Emporia Device Usage'[Usages KWH])),, DESC ), BLANK() )- JamesBurke2 years ago
Helper III
CALCULATE(RANKX(ALL('Emporia Devices'[Device name KP]), // NOT ALLSELECTED[Total Kwh]))I've made conditonal column and use the above Measure , is there a simple way to not include blanks in the rankings ?thanks !