
1. Re: Total Sales with YoY Label
Glenn Kuly Apr 7, 2017 1:46 PM (in response to Andrew Yee)can you post your workbook?
 Glenn

2. Re: Total Sales with YoY Label
Andrew Yee Apr 7, 2017 1:55 PM (in response to Glenn Kuly)unfortunately i cannot, i'm currently just dragging the sales measure to labels and changing calculation to YoY Growth. It looks like this has to be done by calculated field?
(ZN(SUM([Sales]))  LOOKUP(ZN(SUM([Sales])), 1)) / ABS(LOOKUP(ZN(SUM([Sales])), 1))
I found this "formula" but when I use it on my chart, the calculations are wrong and the first column doesn't calculate a value. Can you explain how the formula works? Maybe i can use the logic to adjust? The above calculation as a calculated field turns my chart into this:

3. Re: Total Sales with YoY Label
Glenn Kuly Apr 7, 2017 2:04 PM (in response to Andrew Yee)It's a percentage change formula, but it's impossible to tell from the image what it's based on, or what accounts for the two bar colors and how you've set up the labeling.
A posted workbook would be a huge help.
 Glenn

4. Re: Total Sales with YoY Label
Andrew Yee Apr 7, 2017 2:09 PM (in response to Glenn Kuly)I wish I could share the workbook but unfortunately I cannot. I know it would be super easy to send the workbook and let the pros figure it out in a min =(
The formula above is your simple % growth formula, (X2  X1) / X1 but what does the ZN, Lookup, and 1 mean?

5. Re: Total Sales with YoY Label
Shinichiro Murakami Apr 7, 2017 2:14 PM (in response to Andrew Yee)Hi Andrew,
It's difficult to investigate without data, anyways here is my guess.
// Only filtering display, not filter data
[Filter]
lookup(min(year([Order Date1])),0)
Thanks,
Shin

Tableau_Sample_SS_YTD_SM _9.3.twbx 645.9 KB


6. Re: Total Sales with YoY Label
Glenn Kuly Apr 7, 2017 2:21 PM (in response to Andrew Yee)ZN replaces null values with zero, and the Lookup 1 equals the value one row higher in the table.
I've used the calculated field for annual YoY sales growth in the following dualaxis chart, with the label on top (which will allow you to use a different label inside the bars).
Not sure what fields you are using for sales and previous year sales, or how you are using the filter, but hope this will be helpful:
 Glenn

Book3.twbx 1.2 MB
