Here’s the MDX code to calculate sum of sales amount for last three calendar years:
[code language=”sql” gator=”false”]
with member [measures].[Sales Amount Last Three Years]
[measures].[Sales Amount Last Three Years] on 0
I hope that gives you a good starting point to calculate the Sum of Measure during Last N Periods.
One thought on “SQL Server Analysis Services MDX: Sum of Last N Years, Quarters, Months, Periods.”