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.
Scenario
To understand which of the ‘Product Subcategories’ are not on the ‘Profit Margins’ which the company needs to achieve using Tableau.
Solution
1. Pull ‘Profit’ measure as an aggregated sum and place the dimension ‘Sub-Category’ under rows

Image 1
2. It results in a visual as shown below,

Image 2: Chart Visual
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.

Image 3: Threshold
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,

Image 4: Key Figure Condition
5. Now drag the ‘Calculated Key Figure’ into ‘Marks’ and place it under Text. It results in a visual as shown below,

Image 5

Image 6 – Key Figure
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

Image 7
7. It results in output as shown in Image 8

Image 8: User Input
Finally, the user will be able to get a simple yet useful visualization analysis as shown in Image 9

Image 9: Conditional Formatting in Chart Visual
Alternatively, we can also showcase the same functionality using a reference line:

Image 10: Conditional Formatting
Right click on the X-Axis and choose the option Edit Reference Line. Place the below-shown options:

Image 11: Threshold Reference
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

Image 12: Final Image
Hence we have achieved conditional formatting on Chart Visuals in Tableau.
Read more on Tableau blogs here.
Subscribe to our Newsletter
The post Conditional Formatting on Visual Charts using Parameters in Tableau appeared first on Visual BI Solutions.









