Can I Change Colors by Selection in Tableau?

by Sayd Abdul Tawab Hussainy

The short answer is "YES." I have implemented it with parameters. Let's see how it works.

Step 1: Create a Parameter
Create a parameter that enables color changes by selection. Parameters in Tableau empower users to interactively adjust values in calculations, filters, and reference lines. By establishing a parameter, users gain the ability to select interactively.

Step 2: Create a Calculated Field from Your Parameter
Craft a logical function that activates the parameter and alters the color upon selection of the visualization. In this step, generate a calculated field determining the color of each bubble based on whether its sector matches the user's selection. This field dynamically alters bubble colors based on user interaction.

Step 3: Add the Calculated Field to Color Encoding
In Tableau, assign colors to data points in your visualization based on field values. By placing the calculated field onto the color shelf, Tableau utilizes its values to determine bubble colors. When the calculated field evaluates to "Green" for a bubble, it appears green; otherwise, it appears grey.

Step 4: Create a Dashboard Action to Update the Parameter
Utilize Tableau's dashboard actions to foster interactivity. Create an action updating the parameter (i.e., the selected sector) when users interact with the bubble chart. Clicking on a bubble passes the associated sector value to the parameter, initiating the color change calculation.

Final Step: Test Your Dashboard
After configuring the parameter and dashboard action, thoroughly test your dashboard to ensure proper interactivity. Click on different bubbles in the chart to verify if colors change accordingly. This step confirms that your visualization responds accurately to user interaction.

Check my Global 500 Brands on Tableau Public to see the above mentioned steps in a viz.

Avatar

Sayd Abdul Tawab Hussainy

1 mins read

Thu 16 May 2024

Mon 29 Apr 2024

Sat 20 Apr 2024