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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.