Posted: 11/3/2011
I'm trying to create a calculation that will calculate an average of a daily count, I've tried many different things and have gotten the close to what I want but can't quite get it correct.
The closest I've gotten is the following (using 02/28/2011 as current member)
WITH
MEMBER [Measures].[Count_90D2] AS SUM([Date].[Month].CurrentMember.Lag(0) : [Date].[Month].CurrentMember, [Measures].[Patient Day Count])/COUNT([Date].[Date Key].CurrentMember.Lag(27) : [Date].[Date Key].CurrentMember)
Which gives me the correct number for a 27 day range. However I need to get this to work for 3 Mo, and 12 Mo by changing the CurrentMember.lag(x) to 2 and 11 respectively to get there current month plus the previous x months. I however can't figure out how to get the number of days in the divisor to be correct as I can't just change the lag there. I need the set of all days from the Current Member Month - 2 but I'm at a loss at how to get that result. Any thoughts on how to solve this issue?