Data Visualization with Tableau (35 Blogs) Become a Certified Professional
AWS Global Infrastructure

BI and Visualization

Topics Covered
  • Pentaho BI (9 Blogs)
  • Microsoft BI (1 Blogs)
  • Data Visualization with Tableau (33 Blogs)
  • BI and Data Visualization with Qlikview (1 Blogs)
SEE MORE

MI-new-launch

myMock Interview Service for Real Tech Jobs

myMock-widget-banner-bg

3 Ways To Use Dual Axes Charts in Tableau

Published on Sep 09,2019 68 Views

MI-new-launch

myMock Interview Service for Real Tech Jobs

myMock-mobile-banner-bg

myMock Interview Service for Real Tech Jobs

  • Mock interview in latest tech domains i.e JAVA, AI, DEVOPS,etc
  • Get interviewed by leading tech experts
  • Real time assessment report and video recording

Dual Axes Charts in Tableau are named so because they have two independent axes layered on top of each other. More often than not, they display a combination of different mark types. For example, here you can create a visualization displaying a measure with bars on one axis and lines on the second. 

This is one of my favorite charts in Tableau because there’s the ability to add a new axis, and yet have individual control over the axes. This unlocks some additional flexibility that creates several practical applications that can be used to improve your analysis, user experience, and design.

This post will show you how to build a Dual Axes Charts in Tableau  as well as three different ways to use them: 

 

How to Build Dual Axes Charts in Tableau for their Traditional use

So, I’m going to be using the Sample – Superstore dataset provided by Tableau. Now, let’s begin by making a traditional dual-axis combination chart.

You might be familiar with it, but  I’ll also be sharing a second approach that you may not know which might save you a click or two. 

This first chart portrays sales by year as bars on one axis, and profit ratio by year as lines on the other; both measures shall also be broken down by the Category dimension.

  • To begin, let’s create one of the charts, so I’ll start with Sales by Year by Category.Dual Axes Charts in Tableau
  • Next, let’s place the second measure which is the Profit Ratio on the Rows Shelf.profit ratio

At this point, you have two individual bar charts on two rows. There are two ways in which you can convert these two separate bar charts into a dual-axis bar chart. 

  • First, and the way most people learn, is to right-click on the second measure pill on the Rows Shelf, and choose Dual Axis.

Dual AxesThe second and a slightly more efficient method is to hover over the axis of the second row. 

  • While hovering, a small triangle, green in color, will appear in the upper left-hand corner of the axis. 

  • You can left-click on the triangle and drag it to the opposite axis of the left axis on the first row. 

  • When you hover over the right side of the chart, you’ll see a dashed line where the axis is intended to show up once you release the left mouse key.

chartIn both cases, you end up with a dual-axis bar chart.

Dual Axes Charts in TableauTraditionally this should work better with a dual-axis combination chart. So, that’s what we’re going to do. 

Now, for a dual-axis combination chart, we need a combination of mark types. When you have more than one measure on the Rows Shelf and/or Columns Shelf, each measure ends up getting its own Marks Shelf. What this means is that you can edit the mark types for the measures independently of each other. 

Here’s how the final view looks after I change the mark type of Profit Ratio from bar to line.

Lines should strictly be used when there is a relationship between the data points over time or if they’re being connected by a continuous dimension/measure. Discrete fields are processed in a particular order on the Rows Shelf or Columns Shelf in Tableau. 

So for this example, Sales and Profit Ratio are broken down by the Category dimension first, then the Year(Order Date) dimension second. 

That works, but what if we wanted to break the two measures down by first the Year(Order Date) and then Category? Here’s how it’d look:

 

Using a Dual Axes Chart to make your user part of the story

The following graph is a remake of the CNN Money Calculator from money.cnn.com.

The given viz features a curve that shows how each household income ranks by percentile. This is a very common “descriptive” view that describes high-level statistics. The real value is obtained by using the second axis to display where the individual using the dashboard, ranks on that curve. This makes the user a part of the story and is a way more engaging user experience.

To achieve this effect, I used a parameter in Tableau, which comes in-buit, that would allow the end user to choose any of the household income options between $2,000 and $450,000. 

After making this selection, the circle moves to the appropriate place based on user selection. Also, the label would get updated with a caption telling the end user what percentile rank their household income is in.

This is a dual-axis combination chart. 

The curve for the left axis uses the mark type of a line chart, and the circle is a second measure that only displays a circle for the end user’s selection on the right axis. The trick to getting just one circle to show up is this simple formula that computes whether the user’s parameter selection matches the household income value on the Y-axis.

Once you have this calculation, you can build the curve on the left axis and put the measure for the circle on the right.

To finalize this view, you can synchronise the axes by right-clicking the axis for Circle and select the Synchronize Axis option. 

This ensures the circle to line up perfectly with the line on the opposite axis. Lastly, hide the axis on the right by right-clicking on it and unchecking the option Show Header.

 

Using a dual-axis to Improve the Design of a line graph

Suppose you have a line graph showing sales by month trend.

line graphNow I’ll put the Sales measure on the right axis, synchronize both of these axes, and change the mark type for the second axis to Area.

Dual Axes Charts in TableauAt this point, we have a dual-axis combination chart with Sales by month as a line graph and as an area chart. To finalise the view, hide the right axis and reduce the opacity of the area to 10%.

Dual Axes Charts in TableauYou can only use the second axis for a single purpose at one time. But if you are not using it for one of the former two reasons produced above, this is a third application that can serve to enhance your traditional line graphs.

I hope you have found this piece on Dual Axes Charts in Tableau interesting and understood what they are and how you can use them to unveil the potential in Tableau. 

With this, we come to an end of this Dual Axes Charts in Tableau article. If you wish to master Tableau, Edureka has a curated course on Tableau Training & Certification which covers various concepts of data visualization in depth, including conditional formatting, scripting, linking charts, dashboard integration, Tableau integration with R and more. It comes with 24*7 support to guide you throughout your learning period. New batches are starting soon.

Got a question for us? Please mention it in the comments section and we will get back to you at the earliest.

 

Comments
0 Comments

Browse Categories

webinar REGISTER FOR FREE WEBINAR
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP

Subscribe to our Newsletter, and get personalized recommendations.