Hello Ce Lin,
Firstly, I added variance to label so that you can see that clearly.
Then, I created a loss or gain calc field and added that to the tooltip:
if [Variance] <= 0 then 'loss' else 'gain' end
If you want the variance to always appear positive you can create a calc field with th variance field wrapped in an ABS function.
Donation DriveLB.twbx 30.0 KB
Great, thanks for the help on that!
One other question, in Sheet 1 I'd like to have an additional calculated column that takes the variance and divides it by the Goal to get an overall % variance from Goal. When I create the calculation Variance/Goal, I get the wrong percentage though. Can you help with this/explain why?
1 of 1 people found this helpful
Hi Ce Lin,
To jump in here, the most obvious answer is that you are doing something like:
You need it to be:
(in the first case, Tableau will calculate at the row level and then add them all up, which will give you incorrect results)
Thanks for the explanation! That was exactly what happened.