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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
elle-queue
Frequent Visitor

Stacked bar chart: controlling how columns split

Hi all - I'm having trouble figuring out how to create this graph.  It's something I can easily create in Excel.  I have three columns:

 

Amount we paidSavingsTotal value we could have paid

5

510
10111
51015
202040
5712

 

[sum of amount we paid] + [sum of savings] = [sum of total value we could have paid]

 

What I am trying to do is create a stacked column chart where:

- one bar is [amout we paid] and [savings]

- one bar is [total value we could have paid]

 

I have attached a screenshot of how I've done this in Excel.

 

I've found some solutions but still can't seem to make this happen!  Do I need to create a Measure to sum the columns first?

 

Thank you all!

 

query.jpg

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi ,

 

Based on your description, please create a new table as x-axis and create measures like below:

Measure1 = IF(MAX('Table (3)'[Group])="Payment and savings",SUM('Table (2)'[Amount we paid]),0)
Measure2 = IF(MAX('Table (3)'[Group])="Payment and savings",SUM('Table (2)'[Savings]),0)
Measure3 = IF(MAX('Table (3)'[Group])="Total value we could have paid",SUM('Table (2)'[Total value we could have paid]),0)

Vlianlmsft_0-1647331907988.png

 


Best Regards,
Liang
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

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi ,

 

Based on your description, please create a new table as x-axis and create measures like below:

Measure1 = IF(MAX('Table (3)'[Group])="Payment and savings",SUM('Table (2)'[Amount we paid]),0)
Measure2 = IF(MAX('Table (3)'[Group])="Payment and savings",SUM('Table (2)'[Savings]),0)
Measure3 = IF(MAX('Table (3)'[Group])="Total value we could have paid",SUM('Table (2)'[Total value we could have paid]),0)

Vlianlmsft_0-1647331907988.png

 


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

amitchandak
Super User
Super User

@elle-queue , Create a calculation group with these measures.

Then manually edit that table and the column with those two values on axis.

 

Use the name from the calculation group on legend and the new column as the axis

 

Calculation Groups- Measure Slicer, Measure Header Grouping, Measure to dimension conversion. Complex Table display : https://youtu.be/qMNv67P8Go0

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors