Monday, 6 July 2026

Creating Waterfall Charts in Apache Superset

  

A waterfall chart is a type of data visualization used to show how a starting value is affected by a series of incremental positive and negative changes, leading to a final result.

 

Think of it as a step-by-step story of change, instead of just showing totals, it shows how you got there.

 

A waterfall chart answers this question clearly, How did we move from the starting value to the ending value?

 

It breaks down the journey into individual contributions:

 

·      Positive value: increase the total (upward bars)

·      Negative values: decrease the total (downward bars)

·      Final bar: shows the cumulative result


Let’s take following dataset as an example.

 

monthly_profit_breakdown.csv

step_order,step,amount
1,Opening Revenue,500000
2,Online Sales,150000
3,Store Sales,200000
4,Returns,-50000
5,Discounts,-30000
6,Logistics Cost,-80000
7,Marketing Spend,-40000
8,Final Profit,0

Opening Revenue 5,00,000

This is your starting point. In the chart, this is the first full bar.

 

Online Sales +1,50,000

Your revenue increases due to online orders. Running total: 6,50,000

 

In the chart:

·      This bar goes upward

·      It starts from the top of the previous bar

 

Store Sales +2,00,000

Offline/physical store sales add more revenue.

Running total: 6,50,000 + 2,00,000 = 8,50,000

Chart behavior: Another upward step

 

Returns -50,000

Customers returned products, it is a loss.

 

Running total: 8,50,000 - 50,000 = 8,00,000

 

Discounts -30,000

Offers and promotions reduce revenue.

Running total: 8,00,000 -30,000 = 7,70,000

 

Logistics Cost -80,000

Delivery, warehousing, shipping costs.

Running total: 7,70,000 - 80,000 = 6,90,000

 

Marketing Spend -40,000

Advertising and campaigns.

Running total: 6,90,000 - 40,000 = 6,50,000

 

Final Profit: (auto-calculated)

Even though it's 0 in data, the chart calculates, Final Profit = 6,50,000

 

This appears as the final total bar, usually anchored to baseline.

 

Follow below step-by-step procedure to build Waterfall chart.

 

Step 1: Create dataset from monthly_profit_breakdown.csv file.

 

Data -> Upload CSV to database

 


·      Upload 'monthly_profit_breakdown.csv' file.

·      Select the database and schema where you want to upload the csv file.

·      Give the table name as 'monthly_profit_breakdown'

 

Click on Upload button.

 

Navigate to Datasets listing page, you can able to see the monthly_profit_breakdown dataset.

 

Step 2: Create Waterfall chart.

 

Click on ‘monthly_profit_breakdown’ dataset.

 

It takes you to the chart configuration page.

 


Click on ‘View all charts’ link.

 

   

Search and select Waterfall Chart.

 

Drag and drop step_order to the X-axis.

Drag and drop amount to the Metric.

 

Select SUM as aggregate.

 


Click on Create chart button, you can be able to see Waterfall chart like below.

 

Let’s add legend, X-Axis, Y-Axis labels and update the Chart.

 


Let’s write a custom query like below, so in the X-Axis labels it shows the step name as well.

SELECT
  step_order || '_' || step AS step_with_order,
  amount
FROM public.monthly_profit_breakdown
ORDER BY step_order;

   

Execute above query in SQL Lab.

 


Run the query.

 

Save -> Save dataset.

 

Select Overwrite existing option.

 

It takes you to the chart configuration page.

 

Select the chart as Waterfall, Drag and drop step_with_order to X-axis, amount to Metric, Create the chart.

 

You can be able to see Waterfall chart like below.

 


That’s it, you're good to go.

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment