How to change the colour of the non-highlighted items in Tableau

My face when I discover some challenge!

I really love doing the Workout Wednesday challenges, a weekly challenge imagined and designed by Tableau Ambassadors and Zen Masters : ” The idea is to replicate the challenge that we pose as closely as possible ”.

It’s about learning, collaborating, and having fun. I am always learning more tips about Tableau, each time a bit more, and sometimes, often, I get stuck, for me it’s the fun part of the challenge. And because it’s as well about collaborating, I will share in this post how I solve the fun part, how I discover to do new things.

This week for Workout Wednesday Week 14, Ann Jackson challenge us with a dashboard allowing subcategories dynamical highlighting for comparison, revealing monthly average. I really love her challenges. Her dashboards are precise, enhancing an analytical -easy to read- visualisation and … colorful.

GIF: Can you build a line chart with dynamic highlight and comparison from Ann Jackson

You can click here to view this dashboard on Tableau Public. For this challenge, we were asked to recreate a lines chart that does the following :

1. When clicking on a subcategory at the top,

  • The chosen subcategory will highlight teal and an average line will appear
  • The chosen subcategory will disappear from the bottom selections
  • The chosen subcategory will move to the far left and be teal (remaining sort is ascending by sales)

2. When clicking on a subcategory at the bottom,

  • the next chosen category will highlight hot pink and an average line will appear
  • The bottom chosen subcategory will disappear from the top selections
  • The chosen subcategory will move to the far left and be hot pink

And the last but not least

3. When one or more lines is highlighted, the non-highlighted subcategories will change to a darker gray

This one is pretty simple when you know how highlight works in Tableau, well if you know this part…. Like you can change the color of the highlight sub-categories, I first thought that there was a way of doing that for the non-highlighted items like for the highlighted ones, so I searched for all the editing, formatting, but there was nothing to be found. I searched Google as well without success. If you know where to find that information, just tell me please.

So why is the non-highlighted items are white ?

Let’s look closer at the worksheet, when a sub-category is selected or not.

Doing that you realised that there was no change in the color of the non-highlighted subcategories. What? So why is it happening in the dashboard.

What are the differences between the worksheet and the dashboard?

First the highlighting action is set on the dashboard, and not in the worksheet. So if you add a subcategory highlighter in the worksheet, you’ll have the shading when highlighted.

Second, the background! It was dark grey in the dashboard and none in the worksheet. So this is it, it was the non highlighted subcategories square colour that was shading, leaving the background appeared (for white and none background -transparent sheet- it appear white). And by simply changing the background colour of the worksheet to the exact same one of the dashboard, the problem was solved and the requierement done !

So you can change the colour of the non-highlighted items just by changing the worksheet baackground color!

There are certainly other ways to do it, as Tableau is magic and full of surprises. My bad I didn’t download Ann’s workbook to check. In fact I am always doing the WorkoutWednesday without downloading the challenge workbook (to be honest, I did it one or twice at the beginning when I started the WoW challenge), I just keep convincing myself, that it is not available for download just to make me not giving up on the task. But I will on this one, now that I did the challenge!

Finally I can’t wait, and so I just opened Ann’s dashboard, and I am amazed by how different is it from mine.

She made a dual axis to make appear the average line, I used a single axis lines chart with conditionnal reference line for average.

She used bars for the subcategories displayed, while I used shape (square).

She used one calculated field for the sorting, while I used two (one for each highlighted colour).

All these differences bring me additional knowledge, and I will definitely open all the woorkbook from the Workout Wednesday challenge that I will make in the future.

Tableau gives the freedom to build a same dashboard in so different ways, and following the expression “All the road lead to Rome”, I am enjoying travelling on Tableau’s roads!

I can only encourage you to participate in these challenges, the effect is quite imediate and the practice quick and easy, often I use the techniques learned to make the MakeoverMonday of the following week.

Feel free to download the workbook I made for this challenge, and please share any comment @NatRchr