Forum Discussion
Issue with rolling 6 month average
- 7 years ago
Hi ChrisB1977,
Based on my test, you could refer to below steps:
Create a calender table:
Table = CALENDARAUTO()
Create a measure:
Orders R 6M Ave = DIVIDE(CALCULATE(SUM(Table1[Order number]),DATESINPERIOD('Table'[Date],MAX('Table1'[Month]),-6,MONTH)),6)Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Try to create calcualted measure like below.
Orders R 6M Ave =
VAR DateFilter =
DATESINPERIOD(
table 1[date_et],
MAX(table 1[date_et]),
-6,
Month
)
RETURN
AVERAGEX(
DateFilter,
[Sum of Order numbers]
)
Hi prakash11440278,
That just returned a total of the order numbers unfortunately, rather than the average - is there something else I could try?
Many thanks
Chris
- prakash114402787 years ago
Post Prodigy
Please try the below.
Orders R 6M Ave =
VAR DateFilter =
DATESINPERIOD(
table 1[date_et],
MAX(table 1[date_et]),
-6,
Month
)
VAR RollingSUM =
CALCULATE(
[Sum of order numbers],
DateFilter
)
RETURN
DIVIDE( RollingSUM, COUNTROWS( DateFilter) )