MDX Calculated Measure Expressions

From DataSelf Knowledge Base
Jump to navigation Jump to search

ROLLING PERIOD - AVG OF LAST 30 PERIODS (ONE MONTH IF DAY IS SELECTED)

Avg( LASTPERIODS(30,[Order Date].[Actual Date].CurrentMember), [Measures].[Order Line Regular plus Web Sales Total] )

Avg ( LASTPERIODS (30, [Order Date].[Actual Date].CurrentMember), [Measures].[Order Line Regular plus Web Sales Total] )

iif([Measures].[Order Line Regular plus Web Sales Total]<>0,Avg( LASTPERIODS(30), [Measures].[Order Line Regular plus Web Sales Total] ),null)

ANOTHER VARIATION

Avg (

[Target Dimension].[Target Hierarchy].CurrentMember.Lag(Periods to Lag) :
[Target Dimension].[Target Hierarchy].CurrentMember,
[Measures].[Target Measure]

)


ROLLING PERIOD - LAST 12 MONTHS

[Amt Sales Rolling 12mo - a Period]

iif([Date Document].[Date Document fixed].Currentmember.level.name = "a Period", sum(LASTPERIODS(12,[Date Document].[a Period].CurrentMember),[Measures].[Amt Sales]),0)


ROLLING PERIOD - LAST 365 DAYS

[Amt Sales Rolling 365days - a Date]

iif([Date Document].[Date Document fixed].Currentmember.level.name = "a Date", sum(LASTPERIODS(365,[Date Document].[a Date].CurrentMember),[Measures].[Amt Sales]),0)