Improved Waterfall Chart in Tableau

Improved Waterfall Chart in Tableau

//

A waterfall chart is visualization that helps illustrate the cumulative effect of multiple data elements.  The waterfall chart isn’t my favorite visual, but I’ve softened to it lately.  It’s hard to not like a chart that is sometimes called the Mario chart due to the suspension of the columns.  Before using the waterfall, there are other alternatives out there you should consider, but sometimes a variation on a classic is exactly what your audience needs.

This is a standard example of a waterfall graph provided by wikipedia

 

To recreate in Tableau will involve a little bit of work.  There’s no way to make the standard bar chart “float”, but luckily the Gantt is here to save the day!  First, pull the revenue/expense measure onto the row shelf and the revenue/expense type dimension onto the column shelf.  Use a quick table calculation to create a running total across the chart.   You should end up with a worksheet that looks something like this:

 

 

In our case, we made the final total a part of our datasource (for the purpose of coloring the bars later on), but this means that we need to exclude it from the running sum calculation by editing the Table Calc.  Here’s our final calculation:

RUNNING_SUM(SUM(IF name = 'Total' THEN 0 ELSE [Amount] END))

It’s more than acceptable to do a Grand Total using Tableau’s built in capabilities and not in the data.  This will allow you to skip the previous step, but you’ll have to go about coloring the grand total bar (or background) a little differently then the way then we describe a little later.

So, we have a Gantt bars, but they are a bit anemic.  To fill out the rest of the bar, create a calculated field that is the negative of the revenue/expense amount (i.e. – [Amount]).   Place this calculation on the size shelf.

Finally, create a calculated field to specify the color, note that in our case we reference the Total amount so that it will have a distinct color.  

IF ATTR([name]) = 'Total' THEN 'Total' 
ELSEIF SUM([Amount]) >= 0 THEN 'Positive'
ELSE 'Negative'
END

Pull the Color field onto the color shelf, set your colors, and you should end up with a completed waterfall chart:

 

In this standard waterfall, we’re relying on a red-green color combination to convey meaning, which can be a problem for the colorblind.  Here’s a suggestion to make the waterfall more understandable, while keeping the ubiquitous red-green setup most people ask for:

 

With arrows depicting the direction of change, whether positive or negative, the meaning of the bars is clearer.  To add the arrows, you’ll first need to create an “Arrow location” field that will tell Tableau to position the arrows in the center of each chart:

[Running Total of Amount] + SUM([neg Amount])*.5

Pull this next to your Running Sum calculation and set to Dual Axis with Multiple Marks.  The marks for the Arrow Location axis should be set to shape.  To control the shape, reate an “Arrow Direction” calculation:

IF SUM([Amount]) >= 0 THEN 'Positive' ELSE 'Negative' END

This calculation goes to the Shape shelf, once there, set the appropriate arrows.  The final touch is to get the arrows to vary in size with the bar charts.  Create a calculated field that is the absolute value of Amount:

ABS([Amount])

Add to the Size shelf.  The default size settings will probably not be exact enough, so they should be tweaked.  From the the size legend, click the arrow at the top-right and select Edit Sizes. Set to vary “By Range”, and the Mark Size range to start at the far left.  After you set the “Start value for range” to 0, adjust the top end of the range to match your view and size preference. 

Need Expert Help?

See Our Full Menu of Data Services

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!