LASTPERIODS
Description:
This function is used to return a set of members up to and including a specified member.
Syntax:
LastPeriods(Index [ ,Member_Expression ] )
Return Type:
SET
Parameters:
Parameter | Description |
|---|---|
Member_Expression | It is a valid MDX expression that returns a member. |
Index | A valid numeric expression that specifies a number of periods. |
Example:
WITH MEMBER [Measures].[6 Month Average] AS
AVG(LastPeriods(6, [Date].[Calendar].CurrentMember), [Measures].[Internet Sales Amount])
SELECT
{[Measures].[Internet Sales Amount], [Measures].[6 Month Average]} ON COLUMNS,
[Date].[Calendar].[Month].Members ON ROWS
FROM [AdventureWorksMF_ValueBased]