How To Create Diverging Bars in Tableau Desktop

This guide will explain how to create different styles of Diverging Bar Charts (or Butterfly Charts) in Tableau Desktop.

Diverging bars are charts where two associated measures can be compared side by side.  When used to visualise age demographics these are also referred to as pyramid charts.

For this step by step guide I will use a very simple data set which shows total points for each Premier League team and if they were scored at home or away:

Excel

 

 

 

 

 

 

Once I have connected to the data set in Tableau I can create side by side bars by placing the dimension on the Rows shelf and the measures on the columns shelf:

Bar chart

 

 

 

 

 

 

 

 

 

 

Right click on the left hand axis and select Edit Axis.  Tick Reversed and OK:

Edit Axis Reversed

 

 

 

 

 

 

 

 

 

 

 

 

This gives a basic butterfly chart:

Basic Butterfly Chart

 

 

 

 

 

 

 

 

 

 

 

 

As with all visualisations in Tableau we shouldn’t take the default but should try and make the view as easy to read as possible.  I can easily improve the chart in two ways.  Firstly by ordering the teams by total points won to reflect the league table.  I can then colour code the bars to make it easier to see where the points were earned:

Diverging Bars 1

 

 

 

 

 

 

 

 

 

 

 

Instead of showing the team name as a header on the left hand side we could instead show it in the middle between the bars.  To do this we need to create an additional axis between Home Points and Away Points.  We can do this by creating a calculated field with a default value of zero:

New Axis

 

 

 

 

 

 

Drag this new measure onto the columns shelf between Home Points and Away Points.  Then drag the Team pill from Dimensions onto Label on the SUM(New Axis) Marks card.  The view will now look like:

Coloured Diverging Bars

 

 

 

 

 

 

 

 

 

 

 

To finish the view we need to hide the header for Team on the Rows shelf. Then change the Marks type for SUM(New Axis) from Automatic to Text:

Change Mark Type

 

 

 

 

 

 

Then from the Menu select Format > Lines > Sheet > Zero Lines and set to None:

Zero Lines

 

 

 

 

 

 

 

 

 

Our view will now look like:

Diverging Bars 2

 

 

 

 

 

 

 

 

 

 

 

 

As an alternative to the above we could also present the view with no white space between the bars but still keep the Team name in the middle. This is probably the best use of screen space but will require several steps to complete.  To achieve this click on the SUM(New Axis) pill and select Dual Axis.  SUM(At Home Points) and SUM(New Axis) will now both be plotted on a single pane:

Circles

 

 

 

 

 

 

 

 
Tableau has changed the Marks type from a bar to a circle.  Change these for All Marks back to bar.  Show the header for the New Axis measure, right click on the axis ruler and select Synchronise to bring the scales into line. Right click the axis ruler again and select Edit Axis. Fix the start of the Axis as 0 but allow the end to be Automatic:

Edit Axis Range
 

 

 

 

 

 

 

 

 

 
Changing the SUM(New Axis) mark type to Text will make the view look like:

Butterfly half finished

 

 

 

 

 

 

 

 

 

 

 

Now we need to drag New Axis on to the Columns shelf to the right of Away Points, combine Away Points and New Axis on a dual axis and repeat the earlier steps until the view look like this:

Butterfly Almost Complete

 

 

 

 

 

 

 

 

 

 

 
To make the Team name more readable we need to Format > Borders > Columns and change the Column Divider for Pane to None. We can also change the font of the Team Name so it is more readable:

Edit Label

 

 

 

 

 

 

 

 

 

 

 
Adding a sensible tooltip is also recommended:

Tooltip

 

 

 

 

 

 

 

 
Hiding the SUM(New View) axis will leave us with the finished view: