Forum Discussion

mangoose's avatar
mangoose
Frequent Visitor
7 years ago
Solved

More Complexity/Recalculating with RANKX

I have read all over, and havent found something useful.   I have a dataset with 5 levels of hierarchy, and I am trying to create a leaderboard dashboard at different levels using the same slicer: ...
  • Anonymous's avatar
    Anonymous
    7 years ago

    HI mangoose,

     

    You can try to use below measure formula to get dynamic rank:

    Rank District A =
    IF (
        FIRSTNONBLANK ( Store_Data[District], Store_Data[District] ) <> BLANK (),
        RANKX (
            FILTER ( ALLSELECTED ( Store_Data ), Store_Data[District] <> BLANK () ),
            CALCULATE (
                SUM ( Store_Data[Total Volume] ),
                ALLEXCEPT ( Store_Data, Store_Data[District] )
            ),,,DENSE
        )
    )
    
    
    Rank District B =
    RANKX (
        ALLSELECTED ( Store_Data ),
        CALCULATE (
            SUM ( Store_Data[Total Volume] ),
            ALLEXCEPT ( Store_Data, Store_Data[District] )
        ),,,DENSE
    )
    

     

    Regards.
    Xiaoxin Sheng