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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Cour002
Frequent Visitor

waterfall

Hello,

I have a dataset with a row for each month and various plants, let's just consider plantA and plantB.  There is an initial cost column CostA.  There are also columns for added costs, CostB, CostC, CostD, and a totalCost = [CostA + CostB + CostC + CostD]. What I would like to do is be able to do is get a waterfall chart that has my CostA on the left, then CostB, CostC, CostD as the 'waterfall bars' and totalCost as the far right bar.  Then I would like to be able to be colored by legend plant (plantA and plantB).  Is this possible?  If so, how can I make it happen?  

Thanks!

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

Hi @Cour002

I assume your dataset structures as below

3.png

 

To create a waterfall chart, I create a new table based on the original table by the following formula:

 

Table =
VAR TABLE1 =
    SUMMARIZE ( Sheet1, [plants], [CostA], "cost category""Cost A" )
VAR TABLE2 =
    SUMMARIZE ( Sheet1, [plants], [CostB], "cost category""Cost B" )
VAR TABLE3 =
    SUMMARIZE ( Sheet1, [plants], Sheet1[CostC], "cost category""Cost C" )
VAR TABLE4 =
    SUMMARIZE ( Sheet1, [plants], [CostD], "cost category""Cost D" )
VAR TABLE5 =
    SUMMARIZE ( Sheet1, [plants], [ totalCost], "cost category""totalCost" )
RETURN
    UNION ( TABLE1TABLE2TABLE3TABLE4TABLE5 )

4.png

 

Then in the waterfall chart, add column “cost category” and “Cost” to “Category” and “Y Axis” Fields.

 

5.png

 

“a waterfall chart that has my CostA on the left, then CostB, CostC, CostD as the 'waterfall bars' and totalCost as the far right bar”

To achieve this, you could select three dots on the upper right of the visual to sort by category

 

However, what are difference from your requirement are as follows:

The “Total” bar on the right occurs as the chart created since it counts the total for all categories.

The chart can’t be color by legend, It is colored by category “Increase, Decrease, Total”.

 

 

Best Regards

Maggie

 

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Cour002

I assume your dataset structures as below

3.png

 

To create a waterfall chart, I create a new table based on the original table by the following formula:

 

Table =
VAR TABLE1 =
    SUMMARIZE ( Sheet1, [plants], [CostA], "cost category""Cost A" )
VAR TABLE2 =
    SUMMARIZE ( Sheet1, [plants], [CostB], "cost category""Cost B" )
VAR TABLE3 =
    SUMMARIZE ( Sheet1, [plants], Sheet1[CostC], "cost category""Cost C" )
VAR TABLE4 =
    SUMMARIZE ( Sheet1, [plants], [CostD], "cost category""Cost D" )
VAR TABLE5 =
    SUMMARIZE ( Sheet1, [plants], [ totalCost], "cost category""totalCost" )
RETURN
    UNION ( TABLE1TABLE2TABLE3TABLE4TABLE5 )

4.png

 

Then in the waterfall chart, add column “cost category” and “Cost” to “Category” and “Y Axis” Fields.

 

5.png

 

“a waterfall chart that has my CostA on the left, then CostB, CostC, CostD as the 'waterfall bars' and totalCost as the far right bar”

To achieve this, you could select three dots on the upper right of the visual to sort by category

 

However, what are difference from your requirement are as follows:

The “Total” bar on the right occurs as the chart created since it counts the total for all categories.

The chart can’t be color by legend, It is colored by category “Increase, Decrease, Total”.

 

 

Best Regards

Maggie

 

This worked great Maggie, thanks so much! 

Is there any way to take this one step further and have each bar colored by a category (in this example each plant getting its own portion of the total in each category a certain color)?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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