This is straight mdx
for a 35 day average:
AVG(
TAIL(
[Rental Date].[Date].[Date]
,35
)
,[Measures].[Rental Count]
)
Excel-2013
has custom measures built in.
An alternative is a more generic solution for any measure. so in the following we could put this on columns, and then have various measures on rows (as long as this is created as a member of a hierarchy other than measures)
AVG(
TAIL(
[Rental Date].[Date].[Date]
,35
)
)
If you want this average to consider more than just the last 35 days in the date dimension and you will be including date on say Rows, then something similar to this is good:
WITH
MEMBER [Measures].[MovingAvg35Days] AS
Avg
(
[Date].[Calendar].CurrentMember.Lag(35) : [Date].[Calendar].CurrentMember
,[Measures].[Internet Sales Amount]
)
SELECT
{
[Measures].[Internet Sales Amount]
,[Measures].[Internet Order Count]
,[Measures].[MovingAvg35Days]
} ON 0
,Descendants
(
[Date].[Calendar].[Calendar Year].&[2007]
,[Date].[Calendar].[Date]
) ON 1
FROM [Adventure Works];
olap
functionality in 2013. – whytheq