Create a Dual Color Axis in Tableau

Data

Create a Dual Color Axis in Tableau

With Tableau 8, users gained the ability to color marks by multiple dimensions on a single axis with some automatic combined field magic. What happens though, when you want color by a dimension and a measure? In the past, I have separated out members of a dimension and allowed the specific measure I needed with a calculated field:

Western Region Sales = IF [Region] = ‘West’ THEN [Sales] END

This doesn’t work if I have a more than a pair of items to color (Western Sales, Eastern Sales, etc). Instead, I used a technique that has been possible even before Tableau 8’s addition of multiple colors. The solution also ends up being faster than creating multiple calculated fields and seemed surprisingly obvious once I had finished.

Dual Color Axis Map

Here, I have colored the states by Region, but the intensity of the color is based on the Sum of Sales. The same principle can be applied to a variety of chart types:

Dual Color Axis Bar Chart

The trick is using Dual Axis functionality along with some transparent colors. One of your axes will be colored by your relevant dimension. In the examples above with Superstore data, I have colored States by Region. I then created a Dual Axis with the relevant measure (Bar Chart is Sales, Map is Latitude).

First Axis Colored by Relevant Dimension

For help, see Dan Murray’s post on building a dual axis map.

Second Axis Colored by Measure

On the Marks card, select the axis colored by sales. Then click the Color box and choose Black Sequential.  Also on the Color box, select 65% on the Transparency slider.

Transparency Slider

You should now have the visual effect of a dimension shaded by a measure value!  You will find the workbook I used attached below.  Please comment if you find other useful instances of this trick or your own solution to this problem!


More About the Author

Will Jones

Analytics Consultant / Visualization Practice Lead
2017 Tableau Fantasy Football Draft Kit Jump to the draft kit. We’re well into August, which means American Football is back. The offseason is always excruciating, and ...
Adobe MAX Through the Eyes of an InterWorks Analytics Consultant I started at InterWorks back in olde July 2012 (I used to open casinos), which in Tableau and InterWorks years makes me one of the ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

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