Forum Discussion

MohanV's avatar
MohanV
Frequent Visitor
4 years ago
Solved

Calcualting Top 5 Customers

Hello All,   I have a questoin where I need to find the top 5 customers but with the categories as Tier1 and Tier2.   I have a table as below screenshot Power Query:-  let Source = T...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi MohanV ,

    I updated your sample pbix file(see attachment), please check if that is what you want.

    1. Create a measure as below to judge if a customer is in the top five of the sales ranking

     

    Flag = 
    VAR _rank =
        RANKX (
            ALLEXCEPT ( 'Table', 'Table'[Tier1/2] ),
            CALCULATE ( SUM ( 'Table'[Sales] ) ),
            ,
            DESC,
            DENSE
        )
    RETURN
        IF ( _rank <= 5, 1, 0 )

     

    2. Apply the visual level filter with the condition on the area chart

    Best Regards