Forum Discussion

A_Barny's avatar
A_Barny
Frequent Visitor
8 years ago
Solved

TOP 10 - Pie Chart

Hi everyone,   I am trying to do a pie chart with a TOP 10 resulats. But I want the last top ( number 10) is "Others".   TOP 1 - TOP 2 - TOP 3 - TOP 4 - TOP 5 - TOP 6 - TOP 7 - TOP 8- TOP 9 - Oth...
  • v-frfei-msft's avatar
    v-frfei-msft
    8 years ago

    Hi A_Barny,

     

    I created two new tables as your description. And take the following steps to meet your requirement.
    If your tables are the same as the ones in pbix attached, you can have a try.

     

    1. Create connection between TableA and tableB based on the date columns. Create the YTD measure.

     

    YTD = TOTALYTD(SUM(TableB[Quantity]),TableB[Date])

    2. Create two calculated columns in TableA.

     

    Rank = RANKX(ALL(TableA[Customers]),CALCULATE(SUM(TableB[Quantity]),ALLEXCEPT(TableA,TableA[Customers])))
    top 10 = IF(TableA[Rank]<10, TableA[Customers], "Top Others")


    Then we can get the result as below.

     

     

    For more details, please check the pbix as attached.

     

    https://www.dropbox.com/s/bnaavh9mw9ck5qm/TOP%2010%20-%20Pie%20Chart-re.pbix?dl=0

     

    If you still have questions, kindly share your PBIX file to me.

     

    Regards,

    Frank