KNOWLEDGE BASE

How To Configure Custom Range For Stepped Colors In Highlight Tables Based On Maximum Value In The Table


Published: 08 Jun 2020
Last Modified Date: 08 Jun 2020

Question

How to configure custom range and colors in highlight tables based on maximum value in the table. For example showing sum([profit]) on the view with custom range for stepped colors based on maximum value

Environment

  • Tableau Desktop

Answer

1. Create a calculated field custom color with the below formula:

IF SUM([Profit])<0 then "Orange"
ELSEIF  SUM([Profit])>0 and SUM([Profit])<WINDOW_MAX(SUM([Profit]))/2 then  "red"
ELSEIF SUM([Profit])>WINDOW_MAX(SUM([Profit]))/2  and SUM([Profit])<WINDOW_MAX(SUM([Profit])) then "Green" end


2. Configure the compute using table across then down to get the maximum value from the table in the view.

3. Put this on color and choose the desired values.

4. Change the Mark type to bar.

5. Increase the size to maximum.

6. Drag Min(Number of records) to Size on marks Card.
 

Additional Information

The ability to define custom ranges and colors for stepped colors in highlight tables is not built into the product
Did this article resolve the issue?