Our Certified Tableau Trainers are asked a myriad of questions each day. In this series, they share some answers.
A common question that often comes up in trainings is:
“How can I add conditional formatting to my visualizations?”
Conditional formatting can be a useful way to call attention to textual data. Common cases of conditional formatting involve using Color or Symbols (That’s symbols for all you non-Wingding enthusiasts). Adding conditional formatting to Tableau visualizations allows for important information to be called out much quicker.
Let’s look at a text table that shows the Profit of our Categories and Sub-Categories broken up by year of Order Date:
In order to add color to this table, we can drag an additional copy of Profit to Color on the Marks card. This process would color each Profit value in a continuous gradient color palette where small values are displayed in shades of red and large values are shown in shades of green:
Sometimes, a gradient color choice is not ideal. Instead, a bucketed color system would work better. In order to display color by specific cutoffs, a calculated field can be created to define the buckets. Using “if then” logic, we can define three buckets: High Profits, Average Profits and Low Profits.
Moving the newly created Profit Buckets field to Color on the Marks cards will color the text values of Profit by whichever bucket that they will fall into. Changing the default color selection can be done by double-clicking on the color legend. There are a variety of discrete color palettes available to choose depending on the situation.
Not interested in color? No problem! Symbols are another great way to display conditional formatting if showing the numbers themselves are not mandatory to display. Changing the marks type from Automatic (or text) to Shape reveals the shape button on the Marks card. Dragging the Profit Buckets field off Color and onto Shape changes the numbers into symbols. Similarly to changing the colors, double-clicking on the shape legend allows for different choices of symbols to be selected.