Forum Discussion
CHill86
8 years agoFrequent Visitor
Moving Average - Visual Level Filters Applied
Hi, I got the moving average working as below: MovingAverage2MonthAllRefs = CALCULATE ( AVERAGEX ( ALLSELECTED(Referrals), Referrals[Total] ), DATESINPERIOD ( Referrals[Date],...
Anonymous
8 years agoNot applicable
Instead of one table you should have at least two.
Create a Date table. Link it to your Referral table.
Try the following measure after the above steps.
MovingAverage2MonthAllRefs = CALCULATE (
AVERAGEX ( Referrals, Referrals[Total] ),
DATESINPERIOD (
Dates[Date],
LASTDATE ( Dates[Date]),
-2,
MONTH
)
)I changed the columns in the DatesPeriod function.
CHill86
8 years agoFrequent Visitor
thanks for your reply, but would you mind explaining why a dates table is needed when my source table already includes a date?
- Anonymous8 years agoNot applicable
My answer was based on the assumption you were creating a measure.
In terms of the reason for the date table, you might want to read https://powerpivotpro.com/2011/11/the-ultimate-date-table/