Skip to main content
cancel
Showing results for 
Search instead 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

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors