I'm not completely sure of how your data looks like but perhaps this 2 articles will give you some guidance:
Both use data functions that you can use along other calculations or the measures in your dataset.
Hope this helps!
Thanks Santiago, I think I have explored a similar post to this. The calculation in the first workbook link you gave is the right principle but instead of 'today' I want it the YTD calculation to refer to whatever month is selected in the month filter I have on the workbook. So, if my filter said September 2016, then the financial YTD calculation would sum the monthly figures for April 2016 to September 2016.
In the example it says: IF <= TODAY()
AND DATEDIFF('year',[Order Date],Today())= 0 THEN END
Many thanks for responding to my post.
No worries! I think you can achieve this using Parameters. You can create a Parameter that would allow you to pick a month:
You can then replace TODAY() on the original formula with that parameter:
Note I'm also using another parameter for 'Starting Month', this is just to make the calculation start in April. If this month doesn't change, you could just replace it with something like #04-01-2014#.
An example is attached, but data only goes up to 2014 so you may need to adjust the years
YTD_Parameter.twbx 1.2 MB
Thanks so much. I will give it a go when I'm next working in Tableau..... Will be great if it works for my dataset!
Tableau Community <https://community.tableau.com/?et=watches.email.thread>
Financial YTD and Rolling 12 Month calculations
reply from Santiago Sanchez<https://community.tableau.com/people/santiago.sanchez.1?et=watches.email.thread> in Forums - View the full discussion<https://community.tableau.com/message/560901?et=watches.email.thread#560901>
Hi Santiago, thank you for your reply.... do you have the workbook in an earlier version of Tableau please? I'm working in Tableau 10.... not to worry if not... thank you for your help,
Thank you very much. Happy New Year to you too!