5 Replies Latest reply on Nov 8, 2013 9:11 AM by Mark Palmberg

# Applying calculated field to bar color doubles reference line values

I've attached a packaged workbook that describes my question, which is, when I apply my "Gift In" calculated measure to color the bars in my graph, the color change is reflected accurately in the bars, but my goal reference lines values all double. Thanks for any assistance you can provide in clarifying this for me.

• ###### 1. Re: Applying calculated field to bar color doubles reference line values

You could change your Pyramid Sum Goal to the following:

IF [Pyramid Level]="<10K" THEN 2500000

ELSEIF [Pyramid Level]="10K-25K" THEN 2500000

ELSEIF [Pyramid Level]="25K-50K" THEN 3750000

ELSEIF [Pyramid Level]="50K-100K" THEN 2500000

ELSEIF [Pyramid Level]="100K-250K" THEN 2000000

ELSEIF [Pyramid Level]="250K-500K" THEN 3750000

ELSEIF [Pyramid Level]="500K-1M" THEN 4000000

ELSEIF [Pyramid Level]="1M-5M" THEN 4000000

ELSEIF [Pyramid Level]=">=5M" THEN 5000000

END

ELSE NULL

END

I hope this helps,

Dan

• ###### 2. Re: Applying calculated field to bar color doubles reference line values

That did help, Dan Huff! Thanks. But I'm trying to figure out exactly why. So, really, with the solution you outlined above, I'm only coloring the Potential records, is that it? If it's not too much trouble, could you point me to the KB article that covers how this works in Tableau; I don't yet have the vernacular to even search for it!

Thanks again!

map

• ###### 3. Re: Applying calculated field to bar color doubles reference line values

When you add the Gift In field to color, a value for the goal is given to each of the two marks within each Pyramid Level. This means that instead of 2,000,000 you get 4,000,000.

My change to the calculation takes the Gift In field into account in the formula. Now, Tableau only assigns a Goal value to the bar associated with the Potential member of Gift In. You can see this by hovering over any of the bars in the chart. Any bar that is a Potential bar will have a value for your Goal while any bar that is not will have no value.

Does this help?

Dan

P.S. If you want some general info, my calculation videos might be of help. Here a couple that may help:

String Calculations | Tableau Software

Aggregate Calculations | Tableau Software

1 of 1 people found this helpful
• ###### 4. Re: Applying calculated field to bar color doubles reference line values

Yes, I think I follow now, Dan Huff. Thank you. The only downside to this method, then, is when there are no Potential members present within a pyramid level -- I lose my goal value for that bar.

Thanks also for the links to the videos; I need all the help I can get!

map

• ###### 5. Re: Applying calculated field to bar color doubles reference line values

I just noticed, Dan Huff, that this solution creates duplicate values on my Y axis.