This post shares how to make a waterfall chart in Tableau – a visualization that helps understand how positive and negative values of dimension members are contributing to a total. What makes waterfall charts different from a simple running total calculation is that they illustrate how each dimension member with a positive value adds to a running total and each dimension member with a negative value detracts from a running total. For this tutorial, we will build the following waterfall chart in Tableau which visualizes how each Sub-Category in the Sample – Superstore dataset is contributing to total profit:

## The Setup

To start a waterfall chart in Tableau, create a vertical bar chart showing the measure, Profit, by the dimension, Sub-Category:

Next, add a table calculation to the Profit measure so that it calculates a ‘Running total’ on ‘Table (Across)’. For a refresher on table calculations, see the post: An Introduction to Tableau Table Calculations. After adding the quick table calculation, the view looks like this:

As mentioned in the introduction, while at this point we see how the running total has accumulated across our different sub-categories, it is not easy to determine the positive or negative contribution of each individual dimension member. To make this easier, we will convert this bar chart showing running total to a waterfall chart with a couple of additional steps.

First, change the mark type from ‘Automatic’, which is currently bar, to the ‘Gantt Bar’ mark type.

## The Trick

To get this view to look like the first image above, we need the tops or bottoms of each bar to line up at the same points on the Y-axis. To accomplish this, we have to size the Gantt bars by something in order to extend them. While your first instinct may be to size the Gantt bars by the Profit measure or even the Profit measure on the view which includes a table calculation for running total, there is a trick involved with this step to get the desired effect. In order to get the Gantt bars for each dimension member to properly line up, you first have to create a new calculated field which takes the measure in the waterfall chart multiplied by negative one. This example is using the Profit measure, so we will create a new calculated field that equals –[Profit]:

Once this calculated field has been created, this is the measure that you drag to the Size Marks Card to create the waterfall effect:

## The Finishing Touches

At this point, we have an effective waterfall chart, but there are a few things we did to polish the final product as shown at the beginning of this post:

• Cleaned up the axis formatting.
• Colored the Gantt bars by Profit by dragging the Profit measure to the Color Marks Card; this created the blue and orange color coding which represents positive and negative values, respectively.
• Added a total to the far right side of the visualization by navigating to Analysis > Totals in the top navigation and choosing “Show Row Grand Totals”.

Lastly, you may choose to sort the dimension members by the sequence in which they were introduced or their values by ascending or descending order. As with many uses of Tableau, there is a great deal of inherent flexibility. These types of choices will depend on your analysis, business requirements, and business questions. Now that you know how waterfall charts are constructed in Tableau, experiment with the sort order of the dimension members to get the visualization that works best for you.

### Evolytics

This post is curated content from the Evolytics staff, bringing you the most interesting news in data and analysis from around the web. The Evolytics staff has proven experience and expertise in analytics strategy, tagging implementation, data engineering, and data visualization.