am currently building a ssas cube. I need the default to bring back 2 periods in time. Last month and the month prior to that.
For last month I am using
tail(nonempty([service date].[quarter no - month no].members))
which works perfectly, however it is the previous month to this that I am struggling with.
Can anyone help please? Thankyou.
update:
I am using this mdx as a calculation inside SSAS to then use as a filter for the dataset inside ssrs.
My results are currently:
Contract Name Question TblFct Month Year
------------- ------- ------ ----- ---
New Homes How Many 600 Dec 2014
This is the number for the last month that has data in, i.e. December 2014. I am aiming to have another dataset that is automatically filtered by the same criteria but instead of the last non empty month, I am looking for the month preceeding that. I had looked at the lag function but haven't been able to make it stick for some reason.
My comparison dataset should yield:
Contract Name Question TblFct Month Year
------------- ------- ------ ----- ---
New Homes How Many 450 Nov 2014