How To Display Text Labels In Different Colors According To Conditions

Published: 03 Mar 2022
Last Modified Date: 26 Apr 2022


How to display arbitrary labels according to conditions.

  IF SUM (Profit ) > 30000
       Then indicate with 'GOOD' and green text.
  IF SUM (Profit ) < 10000
       Then indicate with 'BAD' and blue text.

User-added image


  • Tableau Desktop


<Step 1>
 1. Connect to Sample - Superstore
 2. Drag [Category] to Columns and [Region] to Rows.
 3. Drag [Profit] to table.

<Step 2>
 4. Create new Calculated Field as following.
    Name : GOOD_Conditions
    Calculation : IF SUM([Profit]) > 30000
                         THEN 'GOOD'
                         ELSE NULL
 5. Create new Calculated Field as following.
    Name : BAD_Conditions
    Calculation : IF SUM([Profit]) < 10000
                         THEN 'BAD'
                         ELSE NULL
6. Drag [GOOD_Conditions] and [BAD_Conditions] to Text in Mark Card.
7. Click on Text in Mark Card and do the red box below.
    User-added image
8. Arrange text as follows.
    User-added image 
9. Change text color as follows > OK .
    User-added image
Did this article resolve the issue?