Chart guide Tableau and SQL
How do I build a waterfall chart?
Put the steps in order on Columns, the running total RUNNING_SUM(SUM([Amount])) on Rows, set the mark to Gantt Bar and put -SUM([Amount]) on Size, so each bar hangs from where the last one ended. Here it bridges a year of ARR from $1.2M to $1.3M.
The data
Northwind Analytics ARR movements, 2025
A B2B software company starting 2025 at 1.2M annual recurring revenue, with monthly new, expansion, contraction and churn movements.
month | step_order | movement | arr_change |
|---|---|---|---|
| 2025-01-01 | 1 | Starting ARR | 1200000 |
| 2025-01-01 | 2 | New customers | 23589.38 |
| 2025-01-01 | 3 | Expansion | 7955.44 |
| 2025-01-01 | 4 | Contraction | -2721.48 |
Step 1
One bar per movement
Each movement's total for the year. Plain bars all start at zero, so you can't see how they add up.
Tableau
SUM([arr_change])The xmetric engine ran this formula and got the SQL’s ARR change column, row for row.
SQL
SELECT step_order, movement, SUM(arr_change) AS delta
FROM input
GROUP BY step_order, movement
ORDER BY step_orderRows
| Step order | Movement | ARR change |
|---|---|---|
| 1 | Starting ARR | $1,200,000 |
| 2 | New customers | $221,746 |
| 3 | Expansion | $109,311 |
| 4 | Contraction | −$38,007 |
| 5 | Churn | −$143,912 |
Step 2
Lift each bar onto the running total
The running total marks where each step ends. That's the top of a gain and the bottom of a loss.
Tableau
RUNNING_SUM(SUM([arr_change]))SQL
WITH s AS (
SELECT step_order, movement, SUM(arr_change) AS delta
FROM input
GROUP BY step_order, movement
)
SELECT
step_order,
movement,
delta,
SUM(delta) OVER (ORDER BY step_order ROWS UNBOUNDED PRECEDING) AS end_y
FROM s
ORDER BY step_orderRows
| Step order | Movement | ARR change | End y |
|---|---|---|---|
| 1 | Starting ARR | 1,200,000 | $1,200,000 |
| 2 | New customers | 221,746 | $1,421,746 |
| 3 | Expansion | 109,311 | $1,531,057 |
| 4 | Contraction | −38,007 | $1,493,050 |
| 5 | Churn | −143,912 | $1,349,139 |
Step 3
Hang a Gantt bar back to the start
A negative size draws the bar backwards from the running total to where the step began. Gains step up, losses step down, and the end bar lands on the year's closing ARR.
Tableau
-SUM([arr_change])
// on Size, mark type Gantt BarSQL
WITH s AS (
SELECT step_order, movement, SUM(arr_change) AS delta
FROM input
GROUP BY step_order, movement
)
SELECT
step_order,
movement,
delta,
COALESCE(SUM(delta) OVER (ORDER BY step_order ROWS BETWEEN UNBOUNDED PRECEDING AND 1 PRECEDING), 0) AS start_y,
SUM(delta) OVER (ORDER BY step_order ROWS UNBOUNDED PRECEDING) AS end_y
FROM s
ORDER BY step_orderRows
| Step order | Movement | ARR change | Start y | End y |
|---|---|---|---|---|
| 1 | Starting ARR | $1,200,000 | $0 | $1,200,000 |
| 2 | New customers | $221,746 | $1,200,000 | $1,421,746 |
| 3 | Expansion | $109,311 | $1,421,746 | $1,531,057 |
| 4 | Contraction | −$38,007 | $1,531,057 | $1,493,050 |
| 5 | Churn | −$143,912 | $1,493,050 | $1,349,139 |