Please find the attached result and confirm the output. I have observed that you are using old version of tableau. I am attaching the workbook which is of tableau 9.3 version.
I have used below calculations.
1. Filter which will restrict the values from 01/01/2016 to selected date in parameter. Place this in filter section and select true.
[Date]<=[Parameters].[Date] and [Date]>=MAKEDATE(YEAR([Parameters].[Date]),01,01)
2. YTD performance
(SUM([CY Sales]))/(SUM([PY Sales]))
3. YTD running performance %
RUNNING_SUM(SUM([CY Sales]))/RUNNING_SUM(SUM([PY Sales]))
4. Running CY sales or PY sales use the table calculations as below.
Thanks and Regards,
Please find the attached workbook below but Im sure this won't open as you are using older version of tableau. Please refer to the calculations that I have pasted in previous post.
Book2.twbx 24.6 KB
Thanks for the quick reponse!
however this is not the solution i need.
I can't seem to attach files now, so let me try to explain using excel.
Cell H2 is the parameter, so in this case if i select date 5/1/2016, my current YTD PY Sales (C8) will be the sum of C2 to C6
and current YTD CY sales (D8) will be sum of D2 to D6.
Tableau is doing it fine, see 2nd screenshot as the numbers tally.
However the problem appears when i want to calculate YTD performance.
Tableau seems to be summing up column E2 to E6, thus getting 31.7%.
What i need is 6.6% instead (sum of D2:D6)/sum of (C2:C6). Thanks
1 of 1 people found this helpful
The calculations that I have shown above in the first post is doing same thing. Refer to the screenshot below. (Red coloured box) Its giving you the same out put. How ever you can go ahead and subtract 1 from it to get the desired result you want.
Check the below screenshot for the same.
I have changed YTD performance Running as below
(RUNNING_SUM(SUM([CY Sales]))/RUNNING_SUM(SUM([PY Sales])))-1
You can go ahead and remove the months if you want. You will get the desired result.
Yes that's what i needed. Thanks so much!
If your queries are resolved then can you please mark the appropriate response as correct and close the thread. This will help many who are looking for this solution.
Thanks and Regards,