Moving Average issue - Workdays Only

To me it looks like the issue is more that you are looking over every single day in the last month including weekends with this formula.

It doesn’t look like it is taking into account that you only want to average up working days.

Can you try something like this.

I want to see if this will give you the monthly moving average but only for working days.

Sales MA 1M Weekdays = 
VAR WorkingDays = FILTER(
                    CALCULATETABLE( Dates,
                         DATESINPERIOD( Dates[Date], LASTDATE( Dates[Date] ), -1, MONTH ) ),
                                 Dates[Day Type] = "Workday" )

RETURN
AVERAGEX(
    WorkingDays,
        [Total Sales] )

I think it does based on the data I’m working with but I want to check with your example first.

Chrs

1 Like