DAX : Calculate average for Last 4 weeks

Hi All

if you have average measure and needs to calculate for last 4 weeks then create DAX like shown below using DATESINPERIOD function


Average of last 4 weeks = CALCULATE([Average For Report Period],DATESINPERIOD('Date'[Day],LASTDATE('Date'[Week Ending]),-28,DAY))



Average of last 12 weeks = CALCULATE([Average For Report Period],DATESINPERIOD('Date'[Day],LASTDATE('Date'[Week Ending]),-84,DAY))

Comments