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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Create a pie chart for line items with multiple tags (binary in nature 1,0)

I have a dataset which looks like this.

Item No.Category ACategory BValue
111110$1000
222211$2000
33301$3000
444411$2000

I want to create a pie chart which populates the values of both category A and B. 

 

@ValtteriN 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
SUMMARIZE('Table','Table'[Item No.],
"CategoryA 1",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category A]=1)),
"CategoryA 0",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category A]=0)),
"CategoryB 1",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category B]=1)),
"CategoryB 0",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category B]=0))
)

vyangliumsft_0-1650007229702.png

2. Result:

All set to Max.

vyangliumsft_1-1650007229707.png

Please click here for the pbix file

 

 

Best Regards,

Liu Yang

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
SUMMARIZE('Table','Table'[Item No.],
"CategoryA 1",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category A]=1)),
"CategoryA 0",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category A]=0)),
"CategoryB 1",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category B]=1)),
"CategoryB 0",CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Category B]=0))
)

vyangliumsft_0-1650007229702.png

2. Result:

All set to Max.

vyangliumsft_1-1650007229707.png

Please click here for the pbix file

 

 

Best Regards,

Liu Yang

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

ValtteriN
Super User
Super User

Hi @Anonymous ,

Like Amit mentioned you should look into unpivoting the data into a format where you have a category column describing if a row belong to A or B category then use the binary data as the value.





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

Proud to be a Super User!




amitchandak
Super User
Super User

@Anonymous , What will the legend.

If you have two measures category A and Category B, then you can have pie on that without legend.

 

You can unpivot Category A and Category B use the new column as Legend, the 1/0 column as details and value as value

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.