Dax calculation for rolling previous 12 months

shwetasagar

New Member
Joined
Apr 12, 2016
Messages
2
Hi Guys,

I am currently using SSAS tabular model which requires some advanced calculations in DAX. I have got a solution to rolling 12 months problem. But my requirement also includes previous rolling 12 months value too.

By that I mean, if I have say for an example Aug 2015 date, Last rolling 12 months will give me values from Sep 2014 to Aug 2015. Now I need Previous 12 months too, that is Sep 2013 to Aug 2014.

Can anyone of you please help me with this?

Regards,
Shweta
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi Guys,

I am currently using SSAS tabular model which requires some advanced calculations in DAX. I have got a solution to rolling 12 months problem. But my requirement also includes previous rolling 12 months value too.

By that I mean, if I have say for an example Aug 2015 date, Last rolling 12 months will give me values from Sep 2014 to Aug 2015. Now I need Previous 12 months too, that is Sep 2013 to Aug 2014.

Can anyone of you please help me with this?

Regards,
Shweta


Got the solution:

IF (
HASONEVALUE ( datetable[datecolumn] ),
CALCULATE (
SUM ( Table[column] ),
DATESBETWEEN (
Period[dShortDate],
FIRSTDATE ( PARALLELPERIOD ( datetable[datecolumn], -23, MONTH ) ),
LASTDATE ( PARALLELPERIOD ( datetable[datecolumn], -12, MONTH ) )
)
),
ALL ( datetable[datecolumn] )
)
 
Upvote 0

Forum statistics

Threads
1,224,163
Messages
6,176,789
Members
452,743
Latest member
Unique65

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top