Forum Discussion

JamesBurke's avatar
JamesBurke
Helper III
2 years ago

Rank 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 rank one store specfically from this list . 

 

AllSlected function is useful until you drill down creating that Filtered Device to always be rank 1. 

 

Item Rank Device name =
   CALCULATE(
     RANKX(
        ALL('Emporia Devices'[Device Name]), // NOT ALLSELECTED
        [Total Kwh]),
        'Emporia Devices'[Store Name] = "KP"
   )
 
Is what i have tried with the aim it returns a ranking of all the Devices that are in use by the KP store, however it ranks all devices from all stores and ranks them the same value

Any help would be Appericated. 
 
 

6 Replies