Create a Dual Color Axis in Tableau


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

Solutions Architect
2022 Tableau Fantasy Football Draft Kit Last year’s Fantasy Football saw some wild rides, with early favorite Christian McCaffrey injured early and Cooper Kupp going ...
2021 Tableau Fantasy Football Draft Kit Welcome back to a 100% definitely nothing bad is going to happen year in professional football! Last year’s uncertainty didn’t ...

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


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

Telefon: +49 (0)211 5408 5301

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