If today's date is 11 July 2008 then the MTD
sum is for the range {01 July 2008 - 11 July 2008}.
The previous equivalent MTD period in June is {01 June 2008 - 11 June 2008}.
The previous equivalent MTD period in May is {01 May 2008 - 11 May 2008}.
I have the following MDX
script:
WITH
MEMBER [Measures].[PrevEquivalentMTD] AS
//SUM
(
ParallelPeriod
(
[Date].[Calendar].[Month]
,1
,[Date].[Calendar].CurrentMember
)
,[Measures].[Internet Sales Amount]
)
MEMBER [Measures].[PrevEquivalentMTD_v2] AS
Sum
(
Generate
(
{
[Date].[Calendar].[Date].&[20080701]
:
[Date].[Calendar].[Date].&[20080710]
}
,{
ParallelPeriod
(
[Date].[Calendar].[Month]
,1
,[Date].[Calendar].CurrentMember.Item(0)
)
}
)
,[Measures].[Internet Sales Amount]
)
SELECT
{
[Date].[Calendar].[Month].&[2005]&[6]
:
[Date].[Calendar].[Month].&[2008]&[7]
} ON ROWS
,{
[Measures].[Internet Sales Amount]
,[Measures].[PrevEquivalentMTD]
,[Measures].[PrevEquivalentMTD_v2]
} ON COLUMNS
FROM [Adventure Works];
It results in the following:
The measure PrevEquivalentMTD
is not what I'm looking for as it is returning the total for the previous month rather than just the first 10 days.
The measure PrevEquivalentMTD_v2
I'm unsure what this is doing to return the same number for each month.
How do I create a measure that will return the sum of the internet sales for the first 10 days of each month?