Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Pie Chart/Data Help

Hi, I am dealing with a data set that I am trying to make into charts in PowerBI that I can filter in real time. I want to make a chart based on columns C-F. I want a pie chart in which I can select a brand (i.e. Home Depot) and it will show me only the suppliers that are used by the brand. If there is a 1 in column C-F then that brand uses the corresponding supplier in column A. A zero in columns C-F means that brand does not leverage that supplier and therefore I do not want it to show up on the chart.

 

Is there a way to do this with the way the data is currently laid out? This is just a sample of a much larger data set so I am just curious if I can get these results with what I have. 

 

PowerBI Sample.PNG

 

2 REPLIES 2
MFelix
Super User
Super User

Hi @Anonymous ,

 

Create a table with the following data:

 

Brands
AA
BB
CC
DD

 

Replace by your brands name then add the following measure to use on your chart:

 

Pie chart suppliers =
IF (
    COUNT ( Brands[Brands] ) <> 1;
    "Select only one category";
    SWITCH (
        TRUE ();
        SELECTEDVALUE ( Brands[Brands] ) = "AA"; CALCULATE ( COUNT ( Suppliers[AA] ); Suppliers[AA] = 1 );
        SELECTEDVALUE ( Brands[Brands] ) = "BB"; CALCULATE ( COUNT ( Suppliers[AA] ); Suppliers[BB] = 1 );
        SELECTEDVALUE ( Brands[Brands] ) = "CC"; CALCULATE ( COUNT ( Suppliers[AA] ); Suppliers[CC] = 1 );
        SELECTEDVALUE ( Brands[Brands] ) = "DD"; CALCULATE ( COUNT ( Suppliers[AA] ); Suppliers[DD] = 1 );
        0
    )
)

 

 

Use the Brands table as a slicer and check result below:

pie chart.gif

 

Another option would be to unpivot on the brands columsn and then use the new column to make the slicer.

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi, thanks for the info! I am still having some trouble however.... I am newer to powerBI

 

The screenshot above is an example of a spreadsheet I am importing from excel. When you say to add a new table do you mean in excel or within PowerBI? Could you maybe show what you have in the fields column?

 

Also, could you explain how you added the formula to the pie chart specifically? I clicked "New Measure" but I am not sure if that is correct.

 

Thank you so much for your help!

 

JP

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.