RANKX Problem plz help

I have a problem with the Rankx all stores & RKS column.
I want it to show the ranking of a given store within all RKS.
To sum up: the Rankx all stores column shows a dynamic ranking depending on which country and RKS you choose - it works properly.

The Rankx all stores & RKS column should show a dynamic ranking depending on which country you choose, but it should not work with the RKS filter - it should show a total ranking in all RKS.

Code column rankx all stores & RKS:
Rankx all stores & RKS = RANKX(
ALL(DimLocalization[RKS];DimLocalization[StoreID]);
CALCULATE(SUM(FactSales[Revenue_Net]))

Unfortunately, I have an exposed cube and can’t create columns

Hi @Harris,

Please give below a try, it should be able to give required results.

Rankx all stores & RKS =

RANKX (
    CALCULATETABLE (
        SUMMARIZE ( FactSales, DimLocalization[RKS], DimLocalization[StoreID] ),
        ALL ( DimLocalization[StoreID] )
    ),
    CALCULATE ( SUM ( FactSales[Revenue_Net] ) ),
    ,
    DESC
)

Just an example for other reader too, if we want to calculate ranking within certain category, we can use below technique. In below example, we can rank products within each category.

Additionally, we can rank products based on the selection from slicer :slight_smile:

4 Likes