Rolling 12 monhs calculation

Hi I want to calculate the rolling 12-month calculation from the current month so I have used following formula
windowSum(sum(Revenue),[SaleDate ASC],12,0)

but when I do show sub total its not getting total sum for that column any leads would be highly appreciated


With window functions it is important to make sure that granularity of the data is aligned with granularity of expected outcome. For example, if you want results to be sum of past 12 months, make sure that data in the table or chart is at month level and not date level. If the data in the table is listed at day level, then it will calculate the sum for past 12 days and not past 12 months.
If changing the grain of the table doesn’t help resolve the issue, please share the sample data table with up to 13-15 rows of data.

Thank you

Hi, @khushalt5. Did @DeepakS’ solution work for you? I am marking his reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community Q&A Forum!