Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
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
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

1 REPLY 1
Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors