cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## 7 Day Rolling - Issues with date slicer

Hello,

I am trying to put togther a 7 day rolling average and the formula works, but when I use the slicer to select the amount of days I want to see (28, 42, 63) the first couple of days are not calculating the previous vaules it just starts to calculate from the begining of the period selected. I want those intial values to stay stable, continue the pattern, and not recalculate. Below the formula I am using.

► 7 day cancelled meetins =
averageX(
DATESINPERIOD(
'Team Schedules'[Scheduled_Department_Date],
LASTDATE('Team Schedules'[Scheduled_Department_Date]),
-7,
DAY),
CALCULATE([Cancelled Meetings]))
1 ACCEPTED SOLUTION
Super User

Hi,

You should have a Calendar Table with a relationship from the Scheduled_Department_Date of the Team Schedules table to the Date column of the Calendar Table.  Create a Date slicer from the Calendar Table and select a certain date in that slicer.  Now try this measure

7 day cancelled meetins = averageX(DATESINPERIOD('Calendar'[Date],min('Calendar'[Date]),-7,DAY),[Cancelled Meetings])
Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Super User

Hi,

You should have a Calendar Table with a relationship from the Scheduled_Department_Date of the Team Schedules table to the Date column of the Calendar Table.  Create a Date slicer from the Calendar Table and select a certain date in that slicer.  Now try this measure

7 day cancelled meetins = averageX(DATESINPERIOD('Calendar'[Date],min('Calendar'[Date]),-7,DAY),[Cancelled Meetings])
Hope this helps.

Regards,
Ashish Mathur
http://www.ashishmathur.com