Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Rank using multiple attribute columns and 1 value column

Hi all,   Maybe i am stupid, but i am strugling with Ranking formula quite a bit and was not able to find solution afer looking into various online rescources.   I have dataset with various peopl...
  • v-juanli-msft's avatar
    v-juanli-msft
    6 years ago

    Hi Anonymous 

    Create a calcualted column,

    month-year = FORMAT([Day],"Mmmm YYYY")

    Then create two measures

    sum =
    CALCULATE (
        SUM ( 'Table 3'[Value] ),
        FILTER (
            ALLSELECTED ( 'Table 3' ),
            'Table 3'[Name] = MAX ( 'Table 3'[Name] )
                && 'Table 3'[month-year] = MAX ( 'Table 3'[month-year] )
                && 'Table 3'[Group] = MAX ( 'Table 3'[Group] )
        )
    )
    
    rank =
    RANKX (
        FILTER (
            ALLSELECTED ( 'Table 3' ),
            'Table 3'[month-year] = MAX ( 'Table 3'[month-year] )
                && 'Table 3'[Name] = MAX ( 'Table 3'[Name] )
        ),
        [sum],
        ,
        DESC,
        DENSE
    )
    
    

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.