MIP Logo

Customise Your Colour Legend in Tableau

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

Situation

During the past week when working on our first client project, I encountered a colouring problem when building my dashboard. Specifically, the value I wanted to use for colouring the bars has a couple of extremely high values, so the whole viz was looking very pale and it was hard to tell the difference between most values.

               

 

I came out a way to adjust the end value so that the colour difference was more obvious among most bars. However, the number I put in the end value would show up in the colour legend. This was misleading because actually the highest value is much higher than what the legend said.

             

 

Solution

I asked our coach Bethany for suggestion, and got a very useful tip – build my own colour legend in a separate sheet. First, make a copy of the origin sheet. Then calculate the window_min of the value I want to use for colour and put it into detail. Next edit the sheet title to build the customised colour legend. Select a character or icon like rectangle bar and colour it with the two ends of colours on my legend. Insert the window_min value as the start of legend, and manually type “> (the end point value I’ve adjusted on the legend)”. It should look something like this:

 

The last step is to put everything on column and row to detail because I don’t need a chart. Don’t remove them since I still need these details to make my window_min calculation correct. The final customised colour legend look like this, which is quite neat in my opinion:

 

I found this tip simple yet useful to deal with similar situation. The same method could be applied if I’ve got an extremely low value. And I can still keep one side of number on the legend dynamic by using window_min or window_max calculation. Hope you find this useful too!

 

Share this post