Forum Discussion

Balhemkan's avatar
Balhemkan
Icon for Helper III rankHelper III
5 years ago
Solved

Pie chart with others

Hello Team,

 
I am facing difficulty to achieve one requirement.

I am using pie chart  in powerbi
In that I am pulling two columns
CountrySales
India900
Srilanka500
Germany300
Australia1000
Belgium1200
Bangladesh5500
Poland400
 
I want to show top 5 highest countries and rest all should come under "Others" in pie chart. 
like.....
CountrySales
Bangladesh5500
Belgium1200
Australia1000
India900
Srilanka500
Others700
Please help me with dax or any workaround
 
Best Regards,
Balhemkan
  • Hi Balhemkan ,

     

    The visual mentioned by FarhanAhmed  meets your needs, and there is no need to create a new calculated column.

    If you want to highlight the slicer option in the pie chart, try "Enlighten Slicer" visual.

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

9 Replies

    • Balhemkan's avatar
      Balhemkan
      Icon for Helper III rankHelper III

      If we use this . Filter's are not working. Based on our selection we want top 5 and rest all in others

      • VijayP's avatar
        VijayP
        Icon for Community Champion rankCommunity Champion

        Balhemkan 

        In Filter which field you are adding. IF you add the Grouped column Filter works based on selected country! I think some more information is required to explain this

  • Hi Balhemkan ,

    You can create two calculated columns

     

    Top 5 Countries = 

    var rankval= RANKX(Data,Data[Sales],,DESC,Dense)

    var others=IF(rankval<=5,Data[Country],"Others")

    return others
     
    Other Countries = IF(Data[Top 5 Countries]="Others",Data[Country],BLANK())
     
    and then use these two columns like this to create the pie chart

     

    Here is the pbix in case required
     
    Please accept this as a solution if your query has been answered !!
    Appreciate a Kudos ğŸ˜€

     

    • Balhemkan's avatar
      Balhemkan
      Icon for Helper III rankHelper III

      It is working but based on selection it not showing 

      Example if I select australia based on selection top 5 countries we want 

      Could you please help

      • VijayP's avatar
        VijayP
        Icon for Community Champion rankCommunity Champion

        Balhemkan 

        External Filters are going to show only their status in the Visual, When you Select any country it shows that country it self. The filter context should be some thing else to show Top 5 .
        I think you need to explain the objective. 

        1. When you Select Australia do you want Australia and their down below countries

        2. What is the business context show the Top5 

         

        It will help us to give you a better solution! 

  • V-lianl-msft's avatar
    V-lianl-msft
    Icon for Community Support rankCommunity Support

    Hi Balhemkan ,

     

    The visual mentioned by FarhanAhmed  meets your needs, and there is no need to create a new calculated column.

    If you want to highlight the slicer option in the pie chart, try "Enlighten Slicer" visual.

     

    Best Regards,
    Liang
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.