1
votes

I started working with Tableau and want to create a crosstab that displays a measure per customer over the months. The goal is to Display every value >95 as green, the values from 85-95 as yellow and everything below as red. Is this possible?

Thanks a lot in advance.

Picture of the Visualization

1

1 Answers

0
votes

So I start with a view of this

enter image description here

Then I create a dummy calculated field which will represent my color scheme

enter image description here

I drag the Value Color Sum to the color, then the numbers will be colored. To change the color, click on the color button.

enter image description here

To create the "background", I take the "Number of Records" and drag it to Size.

enter image description here

Then I take the measure and change the marks from "Automatic" -> "Bar". I also click on the small white triangle and choose: "Measure" -> "Minimum" to make the bars in the background to fill up the whole cell.

enter image description here

Then I left-click on the size button and drag the slider to the right to make the bar fill the height.

enter image description here

Video of above steps can be found here: How to Conditionally Format Cell Background Color in Tableau


Depending on your data you might need to adjust your measure to make it aggregate, it depends on your data.

For example, my data looks like this:

enter image description here

If I don't aggregate the data the result will be as picture below, since the color will not be applied to the sum of customer A, rather it will be applied to each "row" and therefore the cell will be RED instead of GREEN (See value 110 for January, Customer A).

enter image description here

By aggregating the value I can direct my color scheme to this variable which make the result as I desire.

In this case I used a LOD on customer and Month to create my Sum Value:

{Fixed [Customer], [Month]: SUM([Value])}

enter image description here