It is my understanding that if we want to be very specific about colors (green>=95%, yellow>=90%, red<90%) that we have to build a calculated field to precalculate those colors and then assign the labels to the appropriate color in the color shelf. If we want to color the whole row the same color, that works great. However, we want to vary the color across the row based on the value.
This may be possible (maybe even easy), but based on past failures I'm posting this so you can help educate me. We have multiple columns of percent values, but we want each value in each column to be treated independently for the (non-gradient) coloring. In essence, I'm trying to create something like this:
The easy solution would be to use the gradient coloring and just apply based on each value, but I am unaware of a way to create unequal 'bins' (0-.9, .9-.95, .95-1) for the color; if I do a custom gradient with three colors it seems to want them equal sized.
Can anyone point me to a relevant tutorial, or give me some hints on how to set this up so that each cell/column will be independently evaluated for the corresponding red/yellow/green color based on my required thresholds?
Right now each column is a separate measure, but we can reformat the data structure if needed.
Keith:
No problem at all. Thats the trick, the center value really looking for the center of your range. In my example .3 was the half of 0 - 0.6. If you create custom divergence, the color scale automatically creates the color palette mixing and you would loose your yellow.
I believe there is a Tableau idea to specify center color also and you can vote it.
OK, I have another option and let me know if this works;
- Using a calculated field for the color;
- created a calc field
- My Calc
SUM([Sales]) / TOTAL(SUM([Sales]))
- One more calc field - For Color Num. Make it a mea
if [My Calc] > 0 and [My Calc] < .35 then 1
elseif [My Calc] > .35 and [My Calc] < .45 then 2
else 3
end
NOTE: I used my ranges in the condition
- Used the For Color Num on the color shelf and make it 3 stepped color
- Drag your values to display on to the label shelf
This is what I got and hope this helps;
I changed the calc field with diff numbers and it seemed to work.
..kk