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
atifsiddiqui
Regular Visitor

Waterfall Chart of Product Pricing

Need help in building a waterfall chart. Here is my data:

 

No.ProductSupplier CostShipping CostInventory CostProfit MarginRetail Cost
1Sample Product 11253828
2Sample Product 245321220109
3Sample Product 31023621
4Sample Product 415741238
5Sample Product 517941242
6Sample Product 625851553
7Sample Product 73212152079
8Sample Product 838252217102

 

Each row is one product and all the columns are individual costs, the last column is the sum of all. I need a waterfall chart for each product. I have a filter slicer of the product names. When I select one, this waterfall chart should show the first pillar of Retail Cost and then the waterfall of breakdown of Supplier Cost, Shipping Cost, Inventory Cost, Profit Margin. 

 

When nothing is selected on the slicer, then it would show the full total of Retail Cost as first pillar, then break down of other columns in waterfall.

 

How do I do that? 

1 ACCEPTED SOLUTION
alish_b
Solution Supplier
Solution Supplier

Hey @atifsiddiqui ,

 

The cleanest way to attain this will be by unpivotting the data in Power Query. Your data will look something like this:

alish_b_0-1763541941396.png

Now, I added a Sort Order column so that I can get full control in the waterfall category sort order (You will have to click on Cost Type column in Table View, Under column tools>Sort by column>SortOrder). You could skip this as well if the order of columns other than Retail Cost is not important.
Now you will need to create one measure as follows:

Waterfall Value =
VAR CostType = SELECTEDVALUE(ProductData_Unpivoted[Cost Type])
RETURN
IF(
    CostType = "Retail Cost",
    SUM(ProductData_Unpivoted[Amount]),
    -SUM(ProductData_Unpivoted[Amount])
)
What we are doing above is, Retail Cost will be returned as a positive value, and remaining as negative values --> Retail Cost will be then shown as Increase and remaining as Decrease, making the required waterfall structure.
Now place the, Cost Type in the Category and the above measure (Waterfall value) in the Y-axis. You will get something like this:
alish_b_3-1763542499954.png

Now, remove the legend
Under Columns>Turn off Show total column & change the decrease value to a color of your choice
Turn on data labels. You will have something like this:

alish_b_4-1763542637331.png

Now, obviously I don't want those negative values there, so click on the measure Waterfall Value and under Measure tools in the ribbon, Change format from General to Dynamic and paste this: 

"#,##0;#,##0" 
This formats both positive and negative values as positive (just display is changed but value is preserved)
alish_b_5-1763542789980.png

 

You should have this:
alish_b_6-1763542803962.png

Hope it helps!

PS: Even when you are unpivoting, the connection to source is still maintained so the data should update when there are changes in the source during refresh. It is always best to test anyway.










View solution in original post

3 REPLIES 3
alish_b
Solution Supplier
Solution Supplier

Hey @atifsiddiqui ,

 

The cleanest way to attain this will be by unpivotting the data in Power Query. Your data will look something like this:

alish_b_0-1763541941396.png

Now, I added a Sort Order column so that I can get full control in the waterfall category sort order (You will have to click on Cost Type column in Table View, Under column tools>Sort by column>SortOrder). You could skip this as well if the order of columns other than Retail Cost is not important.
Now you will need to create one measure as follows:

Waterfall Value =
VAR CostType = SELECTEDVALUE(ProductData_Unpivoted[Cost Type])
RETURN
IF(
    CostType = "Retail Cost",
    SUM(ProductData_Unpivoted[Amount]),
    -SUM(ProductData_Unpivoted[Amount])
)
What we are doing above is, Retail Cost will be returned as a positive value, and remaining as negative values --> Retail Cost will be then shown as Increase and remaining as Decrease, making the required waterfall structure.
Now place the, Cost Type in the Category and the above measure (Waterfall value) in the Y-axis. You will get something like this:
alish_b_3-1763542499954.png

Now, remove the legend
Under Columns>Turn off Show total column & change the decrease value to a color of your choice
Turn on data labels. You will have something like this:

alish_b_4-1763542637331.png

Now, obviously I don't want those negative values there, so click on the measure Waterfall Value and under Measure tools in the ribbon, Change format from General to Dynamic and paste this: 

"#,##0;#,##0" 
This formats both positive and negative values as positive (just display is changed but value is preserved)
alish_b_5-1763542789980.png

 

You should have this:
alish_b_6-1763542803962.png

Hope it helps!

PS: Even when you are unpivoting, the connection to source is still maintained so the data should update when there are changes in the source during refresh. It is always best to test anyway.










Kedar_Pande
Super User
Super User

@atifsiddiqui 

 

You need to unpivot your data in Power Query.

Select all cost columns except Retail Cost, then Transform > Unpivot Columns. This creates "Attribute" (cost type) and "Value" columns.

 

If this answer helped, please click Kudos or mark as Solution.
-Kedar
LinkedIn: https://www.linkedin.com/in/kedar-pande

That's great. However, I have several other columns in the same table that are now getting messed up. Is there a way I can make a new table separating these 4 columns from the main table and do this unpivot on the new table. While keeping the reference alive, so that whenever any changes happen in the excel sheet, I come to Power BI and refresh and it picks those changes and also updates this new table with these 4 columns that are now unpivoted?

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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