-
1. Re: Cell Color-Coding
Michel Caissie Feb 11, 2019 11:31 AM (in response to Dean Frickey)Dean,
Here is on possible solution.
Create two color logic calculation for each measure you want to color.
case ATTR( [Valid] )
when 'NO' then
if SUM([% Count]) > .04 then 'CntRed'
elseif SUM([% Count]) > .02 then 'CntOrange'
elseif SUM([% Count]) > .005 then 'CntYellow'
else 'CntWhite'
end
else 'CntWhite'
end
and
case ATTR( [Valid] )
when 'NO' then
if SUM([% Volume]) > .04 then ' VolRed'
elseif SUM([% Volume]) > .02 then ' VolOrange'
elseif SUM([% Volume]) > .005 then ' VolYellow'
else 'VolWhite'
end
else 'VolWhite'
end
Concatenate both in what will be your final Color measure
[Color(%Count)] + [Color(%Volume)]
Now, Ctrl-Click Color and Measure Names and drag both on the color shelf.
You can see that you get a color for every possible combinations. Just set the colors accordingly.
-
sample2(mc).twbx 50.7 KB
-
-
2. Re: Cell Color-Coding
Dean Frickey Feb 11, 2019 1:39 PM (in response to Michel Caissie)Thank you. I'll try using your idea.
-
3. Re: Cell Color-Coding
Matt LuttonFeb 12, 2019 9:11 AM (in response to Dean Frickey)
1 of 1 people found this helpfulIf you want to dive in and learn more about why this is challenging in Tableau versus Excel, I would recommend the following blog/reading:
Older But Still Useful – Conditional Formatting | Drawing with Numbers
Anything is possible in Tableau, but Tableau works with 'marks' and not 'cells' -- the trick in the above example is using multiple dual axes setups to produce multiple marks cards. So, finding a way to color the "marks" in your view should always be the goal in Tableau, and with text, that means all the text on a marks card gets whatever is on the color shelf.
I hope this helps -- sometimes just changing the chart into a multiple measure bar chart or something else visually helps to make the conditional formatting more consumable in Tableau.