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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
FacuZodi
New Member

Donut Chart with multiple columns as Legends

I am struggling to find a way to make a donut chart the way I want it to look.

 

I have a table like this:

Table1

Customertotal banana apple orange date
A15501001/01/22

B

202002/04/22

C

1252503/11/22

 

I also made a measure that calculates the average total cost per month, but I don't know if this is how I should build it, or if I should make individual measures for each product's average:

 

Avg. Monthly Costs = AVERAGEX( VALUES(Table1[date]), [banana cost] + [apple cost] + [orange cost])

 

I'd like to make a pie/donut chart that shows average monthly costs per product, so it would have "Banana", "Apple" and "Orange" as the legends and the average cost per month as the value.

 

Any help is appreciated! Thanks!

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @FacuZodi ;

We could unpivot columns in power query.

vyalanwumsft_0-1662689089833.png

Then create a measure.

averge = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALL('Table'),[fruit]=MAX('Table'[fruit])&&EOMONTH([date],0)=EOMONTH(MAX('Table'[date]),0)))

The final show:

vyalanwumsft_1-1662689300420.png


Best Regards,
Community Support Team _ Yalan Wu
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

1 REPLY 1
v-yalanwu-msft
Community Support
Community Support

Hi, @FacuZodi ;

We could unpivot columns in power query.

vyalanwumsft_0-1662689089833.png

Then create a measure.

averge = CALCULATE(AVERAGE('Table'[Value]),FILTER(ALL('Table'),[fruit]=MAX('Table'[fruit])&&EOMONTH([date],0)=EOMONTH(MAX('Table'[date]),0)))

The final show:

vyalanwumsft_1-1662689300420.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.