KNOWLEDGE BASE

Conditionally Formatting Cell Background Color


Published: 30 Jan 2013
Last Modified Date: 01 May 2017

Question

How to format cell background color based on a KPI (key progress indicator).

Environment

Tableau Desktop

Answer

This article expands on the steps for creating key progress indicators, adding information for formatting the cell background color based on the indicator value.

Step 1: Create a KPI 

Create a KPI view using the steps provided in Creating Key Progress Indicators (KPIs).

You can also download the attached sample workbook to see the finished result.

Step 2: Set up conditional background color

  1. Drag the KPI field to Color on the Marks card.
  2. Change the mark type to Bar.
  3. (Optional) Click the arrow in the upper-right corner of the Color legend, select Edit Colors, and select the color palette you want.
  4. Drag Number of Records to Size on the Marks card.
  5. Click the arrow in the upper-right corner of SUM(Number of Records), select Measure (Sum) > Minimum
  6. Adjust mark size as desired. See Size Properties for more information.
  7. (Optional) Hide the Number of Record Card. 
To view these steps in action, see the video below: 

Additional Information

This article expands on the steps for creating key progress indicators, adding information for formatting the cell background color based on the indicator value.

Note: To color the background of the dimensions located in the Rows, see the workaround described in the following Community thread: How to display the range for measure and highlight the dimensions.
Did this article resolve the issue?