I've used this but will go through your suggestion,
7 day rolling:=VAR mdate = MAX('Calendar'[Date])
VAR anser =
CALCULATE([Tsales],DATESINPERIOD('Calendar'[Date],mdate-6,7,DAY))
RETURN anser
Then to get 1,2,3,4,5,6 and then 7 onwards,
count:=VAR mdate = MAX('Calendar'[Date])
VAR drange = DATESBETWEEN('Calendar'[Date],mdate-6,mdate )
RETURN
COUNTROWS(drange)
and lastly
Rolling Avg by Count:=VAR div1 = [7 day rolling] / [count]
VAR count1 = [count]
VAR anser2 = [7 day rolling]/7
RETURN
IF(count1 <7 ,div1,anser2 )
Seem to work, I'll let you know how I get on with your suggestion,
Richard.
Bookmarks