When I was building a sales report in Tableau, I wanted to highlight the top-performing products in green and the low-performing ones in red. At first, I thought I had to create a calculation, but then I got the expected output using the conditional formatting in Tableau.
In Tableau, conditional formatting allows us to highlight values, apply custom colors, or use icons based on specific conditions. This makes Tableau charts more interactive and easier to read.
In this tutorial, I will explain how to apply conditional formatting in Tableau charts using examples.
Conditional Formatting in Tableau
In Tableau, there are three methods through which we can apply conditional formatting in Tableau charts.
- Conditional formatting in Tableau using color shelf
- Conditional formatting in Tableau using highlight tables
- Conditional formatting in Tableau using a dual-axis chart
In the examples that follow, we will discuss how to apply conditional formatting in Tableau using the Tableau Superstore data set.
Conditional Formatting in Tableau Using Color Shelf
To apply conditional formatting in a Tableau chart, the simplest method is to use the color shelf.
In this chart, we will show the sales across different product subcategories, and in the condition, we will display the bars with sales less than 150k in red and more than that in green.
Now, connect the Tableau with the Superstore data set and follow the steps below to apply conditional formatting in Tableau using the color shelf.
- To create the chart view, add the Subcategory to the Rows and Sales to the Columns. With this, we will get a bar chart on the sheet.

- For color formatting, either add ‘profit‘ or ‘sales‘ to the color card.

- To apply the conditional formatting, click on the color card and select Edit Colors.
- In the Edit window, select a diverging color such as the Red-Green diverging color. For conditional formatting, enter custom values for Start as 0, Center as 150000, and End as the last range, or keep it default.

Now, according to the conditional color formatting, we will see that bars with sales less than 150k are in red, and bars with sales more than 150k are in green.

This way, we can apply conditional formatting in Tableau using the color shelf.
Conditional Formatting in Tableau Using Highlight Tables
When displaying data in a table format instead of bars, using highlight tables is the ideal way to show conditional formatting.
In this example, we will highlight the sales profits using the formatting in the highlight table.
- Drag the Category to Rows and Region to Columns. After this, drag Sales to Text in the Marks section.
- From the “Show me” tab, choose “Highlight Table.”

- Now drag the Profit to the Color. This will shade each cell based on profit values.

- For the formatting, we can also select a different color gradient, such as ” diverging red green” that will show profit in green shades and loss in red.

With this, we will see the loss or lower profit in red color shades and the profit values in green color shades.

This way, we can apply conditional formatting in Tableau using the Highlight tables.
Conditional formatting in Tableau Using a Dual-Axis Chart
Another method through which we can apply conditional formatting in Tableau is using the Dual-Axis chart.
In this chart, we will display the profit in product subcategories.
- Drag the dimension Sub-category to the Rows.
- After this, go to Columns and enter “1” to create an average measure.

- By default, the measure will be in sum, so click on it and select a Measure(sum) -> Average.

- Now, add the avg(1) again to the Columns to create the duplicate chart.
- Click on the second axis and select Dual-axis.

- Now, right-click on the axis and select Edit Axis. In the edit window, select Synchronize dual axes. In the Axis titles, enter the custom title as Profit. Repeat the same on the second axis.

- In the All Marks section, select the type as Bar.

- Drag the Profit to the color card in the All Marks section.

- To set only two colors, such as red and green, instead of shades, click on Edit Colors in the color card.
In the Edit color window, select the diverging red-green color. Then select the checkbox, stepped color, and enter 2.

With this, we will get the profit values in red for bars with less profit and in green for higher profit. This color range is also decided in the Edit color window, where we can customize the start and end.

This way, we can apply conditional formatting in Tableau using the dual-axis chart.
Conclusion
In this Tableau tutorial, we have learned three different ways to apply conditional formatting in Tableau: using the Color Shelf, Highlight Tables, and Dual-Axis Charts.
According to requirements, we can use the Color Shelf method for simple bar charts, Highlight Tables for tabular comparisons, and the Dual-Axis approach to format measures separately.
You may also like to read:
- Sort Values in Tableau Stacked Bar Chart
- Tableau Gantt Chart With Start and End Date
- Tableau Gantt Chart With Milestones
- Funnel Chart With Multiple Measures in Tableau

Abhijeet is a skilled Salesforce developer with experience in developing and integrating dashboards, data reports, and Salesforce applications. He is also skilled at optimizing processes and flow automation processes, coding, and executing complex project architecture. Read more about us | LinkedIn Profile.