I have been using tableau more and more for building simple dashboards to provide views on totals for various metrics. I have created a parameter to allow to switch between day grouping, week, monthly and yearly views as a drop down, however I have been asked if it can be done to show a cumulative view.
IE if I selected Week on a Wednesday it would show the cumulative view for every week up until the weds (or what ever day they were looking at) so we can see where we stand that week in relation to previous weeks, I would also like to do the same for the montly view so if you were on say the 9th of january and viewed the previous 12 months it would show the total for those months up to the 9th.
I think this can be done using a date trunc but it is not something I have much experience with so anny suggestions would be appreciated.
We have a great number of resources for working with to date calculations in the FAQ: To Date Calculations page. This is a great starting place for several examples around the forums in in related blogs.
I hope this assists you with a resolution and if you have more questions, please be sure to share.