MIP Logo

How to Change the Colour of Bars Based on Average Values 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

Context

As you can see from the screenshot above, the bar chart has a lot of categories but it has no colour difference. You can still see which category comes below or above average, it is still hard to pinpoint. Tableau can improve this view using a simple True/False calculation field.

In the screenshot above, the bars have different colours based on whether they are below or above the average lines.

This post will walk through how you can change the colour of the bars.

 

 

Change the Colour of the Bars

The first and most important step is to create a calculated field. This calculated field will contain a formula that specifies the range for below or above based on the average value. One thing to pay attention to here is to write the formula with the right values, especially when you are using LOD expressions. Otherwise, the bars might change colours based on different levels of granularity.

 

Once the calculated field for colour is created, the next step is to bring it “Color” section of the “Marks” panel.

Lastly, right-click “AGG(Colour)” and go to “Edit Colours,” where you will be able to assign specific colours for average below or above.

It is one of the basic Tableau skills that you can easily apply to your chart. But, it will greatly improve your chart from a visualization perspective. I hope you learned something new, and your dashboard will look more intuitive and effective.

 

Share this post