One thing... the coloring - your example formula, doesn't match the Excel example... no matter.
I have amended the colour formula to match Excel.
If SUM([Diff]) >= 100 THEN "Green"
elseif SUM([Diff]) <= -100 THEN "Yellow"
elseif SUM([Diff]) >= -100 and SUM([Diff])<0 THEN "Red"
Example attached, made in 9.3.1
You may find these blogs useful, it describes the technique
207256.twbx 20.4 KB
Thank you for your reply.
Let's I will for the same.
Between John's and my example, do you have what you need?
John uses a slightly different method, but as you can see, the outputs are largely the same.
My technique is more difficult to implement, and in some cases isn't useful, but if you plan on developing in Tableau, it is something worth knowing, its the best way of getting maximum formatting control in Tableau.
You may need to adjust the colour formula on both solutions depending on need, you'll note that i wrap SUM() round the DIFF statements, that is deliberate.
@John, neat work by the way
1 of 1 people found this helpful
Thanks Mark & John, this helped.
But my calculated field has values that don't currently exist in my data set. They are capability levels such as 0,1,2,3,4 and these value are used to conditionally format the cell background. Values 3 & 4 do not exist in the data set yet, and as a result don't appear in the Edit Colors panel for the calculation. Is there a way to manually add these values or do I need to get the value into the data set in order to assign colors to the values? When these values appear in the data source, then the cells would be formatted.