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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
anonymous123789
Regular Visitor

Rolling 3 month average excluding December and currrent month

So I've done some research on rolling averages the last couple days. I've been somewhat successful in coming up with a solution but I'm not quite there. I have a date table and a formula to calculate average wait time, which is measured by averaging up a calculated colum. Here's my formula for the rolling average:

 

Wait Time 3 Month Rolling Average =
CALCULATE (
AVERAGEX ( VALUES ( 'Date Table'[Month] ), [Avg. Wait Time %] ),
DATESINPERIOD ( 'Date Table'[Month], MAX ( 'Date Table'[Month] ), -3, MONTH)
)
 
Some problems:
1. It doesn't exclude December, but it should
2. I believe it includes the current month in the calculation, but it shouldn't
 
For example, when February is selected in the month filter, I want the measure to calculate the average wait time from January, November, October.
 
Please help! Thanks
1 REPLY 1
amitchandak
Super User
Super User

@anonymous123789 , Try something like

 

CALCULATE (
AVERAGEX ( VALUES ( 'Date Table'[Month] ), [Avg. Wait Time %] ),
DATESINPERIOD ( 'Date Table'[Month], eomonth(MAX ( 'Date Table'[Month] ),-1), -3, MONTH)
)

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors