MDX Calculated Measure to get Cumulative Sum from First Month to Last Month of each year

1.5k Views Asked by At

I would like to get Cumulative Sum from Jan - Dec for each year

Something similar to Below But replace First Month and Last Month with the current year data. I have data from 2014 -2017

Sum( [Ship Date].[Date].CURRENT_MEMBER.FirstMonth : [Ship Date].[Date].CURRENT_MEMBER.LastMonth,[Measures].[Revenue] )

1

There are 1 best solutions below

2
On

You may be able to use this structure which I’ve taken from the MSDN YTD page:

WITH MEMBER MEASURES.YTDDEMO AS
AGGREGATE(YTD(), [Measures].[Internet Sales Amount])
SELECT {[Measures].[Internet Sales Amount], MEASURES.YTDDEMO} ON 0,
[Date].[Calendar].MEMBERS ON 1
FROM [Adventure Works]

Here is another alternative:

Aggregate(

     PeriodsToDate( 
           [Date].[Calendar Hierarchy].[Year],
           [Date].[Calendar Hierarchy].CurrentMember 
     ),
     [Measures].[Sales]
 )