*How to create a waterfall chart in Tableau*

*How to create a waterfall chart in Tableau*

September 26, 2016

Want to create a waterfall chart in Tableau? It actually isn't hard at all.

Here is an example. Using Superstore data, I want to show the year over year change in sales, by state.

Let’s start by calculating the difference. I created a calculation to work out the difference, by right-clicking and selecting Quick Table Calculation > Difference.

Now I have a table that shows the difference in sales, by state. I want to display it as a waterfall chart. How do I do that?

Let's go to the Marks Card and select Gantt Bar instead of Automatic. Next, let's place a Sales Difference calculation on Rows.

We can clearly see the change in sales now:

Let's make it look more like a waterfall chart.

Double click on the SUM(Sales) calculation. You will see the calculation looks something like this:

(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)

Add RUNNING_SUM() to calculate the running total of the change in sales. Here is an example:

RUNNING_SUM((SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1))

Copy the calculation you just created. Now right click on the Rows and select New Calculation. Paste your calculation here, remove the RUNNING_SUM() part, and multiply by (-1) to compute the size of the change in sales. Here is my calculation:

(SUM([Sales])) - LOOKUP(ZN(SUM([Sales])), -1)*-1

Drag and drop this calculation onto Size on the Marks Card. The bars will fill up.

Now let's show the positive and negative change with color. While holding the Ctrl key, drag and drop the running total difference in the sales calculation from the Rows, and place it on the color Marks Card. Tableau will create a copy of your calculation and color your bars. Click on Color Marks Card and select Edit colors. Check the Stepped Color checkbox and reduce the number of steps to 2.

That's it! You now have a waterfall chart.

Don’t forget to subscribe to receive more data visualization tips and tricks!