Forum Discussion

elle-queue's avatar
elle-queue
Frequent Visitor
4 years ago
Solved

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!

 

  • 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)

     


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

2 Replies

  • 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

  • V-lianl-msft's avatar
    V-lianl-msft
    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)

     


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