With a DAX measure as below, is there a way to adapt the date range to reflect the last 30 days with observations instead of 30 continuous calendar days?
The source data does not contain records for each calendar date.
30D Mov Avg =
VAR NumDays = 30
VAR RollingCount = CALCULATE(COUNT(‘ServiceRecord’[Activity ID]), DATESINPERIOD(‘ServiceRecord’[Service Date], LASTDATE(‘ServiceRecord’[Service Date]), -NumDays, DAY))
RETURN
RollingCount/NumDays
The source data does not contain records for each calendar date.
30D Mov Avg =
VAR NumDays = 30
VAR RollingCount = CALCULATE(COUNT(‘ServiceRecord’[Activity ID]), DATESINPERIOD(‘ServiceRecord’[Service Date], LASTDATE(‘ServiceRecord’[Service Date]), -NumDays, DAY))
RETURN
RollingCount/NumDays