
1. Re: Dual axis bar chart with line for variance
Lucie Brett Mar 18, 2018 9:30 AM (in response to ce.lin)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


2. Re: Dual axis bar chart with line for variance
ce.lin Mar 18, 2018 6:10 PM (in response to Lucie Brett)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?

3. Re: Dual axis bar chart with line for variance
Paul Field Mar 18, 2018 6:42 PM (in response to ce.lin)1 of 1 people found this helpfulHi Ce Lin,
To jump in here, the most obvious answer is that you are doing something like:
[Variance]/[Goal]
You need it to be:
Sum([Variance])/sum([Goal])
(in the first case, Tableau will calculate at the row level and then add them all up, which will give you incorrect results)

4. Re: Dual axis bar chart with line for variance
ce.lin Mar 18, 2018 6:52 PM (in response to Paul Field)Thanks for the explanation! That was exactly what happened.