Support Formation DAX
Gestion des dates

icon picker
Moyenne mobile

Sales R12M =
VAR NumOfMonths = 12
VAR LastCurrentDate =
MAX ( 'Date'[Date] )
VAR Period =
DATESINPERIOD ( 'Date'[Date], LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
CALCULATE (
AVERAGEX (
VALUES ( 'Date'[Calendar Year Month] ),
[Sales Amount]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, 'Date'[Date] )
VAR LastDateWithSales = MAX ( Sales[Order Date] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithSales, Result )

Sales R12M day granularity =
VAR NumOfMonths = 12
VAR LastCurrentDate =
MAX ( 'Date'[Date] )
VAR Period =
DATESINPERIOD ( 'Date'[Date], LastCurrentDate, - NumOfMonths, MONTH )
VAR Result =
CALCULATE (
AVERAGEX (
VALUES ( 'Date'[Date] ),
[Sales Amount]
),
Period
)
VAR FirstDateInPeriod = MINX ( Period, 'Date'[Date] )
VAR LastDateWithSales = MAX ( Sales[Order Date] )
RETURN
IF ( FirstDateInPeriod <= LastDateWithSales, Result )

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.