There is always a need for the user to take quick decisions based on the visuals obtained. Color indicators will help users achieve this goal. This blog explains how users can use conditional formatting in Tableau to arrive at better decisions.
Conditional formatting in Tableau can be achieved with the use of ‘Parameters’.
‘Parameter’ can act as a placeholder for a value on which a condition will be called.
To understand which of the ‘Product Subcategories’ are not on the ‘Profit Margins’ which the company needs to achieve using Tableau.
1. Pull ‘Profit’ measure as an aggregated sum and place the dimension ‘Sub-Category’ under rows
2. It results in a visual as shown below,
Now we need to understand a way that could help us highlight the subcategories that are not within the Profit Margins.
To achieve this, we will need to follow the below steps:
1. Let’s start creating a ‘Parameter’ using the below value and selection.
2. We will name the ‘Parameter’ as ‘Threshold’ to act as a base condition, on which the visuals will change color
3. Now, create a calculated field with a simple ‘IF case’ scenario to highlight the ‘Sub-Categories’ that are not performing well and place them with text indicators
4. Create a new ‘Calculated Key Figure’ and name it as ‘High-Profit Subcategories’ and place the below-shown condition,
5. Now drag the ‘Calculated Key Figure’ into ‘Marks’ and place it under Text. It results in a visual as shown below,
6. To get the threshold as a dynamic input field right click on the threshold and select the below option as shown in Image 7
7. It results in output as shown in Image 8
Finally, the user will be able to get a simple yet useful visualization analysis as shown in Image 9
Alternatively, we can also showcase the same functionality using a reference line:
Right click on the X-Axis and choose the option Edit Reference Line. Place the below-shown options:
Use the same ‘Calculated Key Figure’ created before named, ‘High-Profit Subcategories’ and drag it to color under Marks.
The Final Result will look like Image 12
Hence we have achieved conditional formatting on Chart Visuals in Tableau.
Read more on Tableau blogs here.