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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SIMMI
Frequent Visitor

Rolling Average with conditions

I'm trying to find a rolling average value of the 'Repair Time' in the last 24 months. For any given date, I need to find the average of all the repair times where both the 'RaisedDateTime' and 'ClosedDateTime' fall in the last 24 months time frame.

 

For example, on January 01, 2022 ('MonthSummary'), I need to find the average repair time of all entries with both RaisedDateTime and ClosedDateTime from January 01, 2020 - December 31, 2021. The 'MonthSummary' takes the first date of the month that corresponds to the 'ClosedDateTime' whaich is taken as the base date.

 

SIMMI_0-1670860442204.png

 

I'm new to PowerBi and not familiar with DAX coding. Any help would be much appreciated.

 

Thanks in advance.

1 REPLY 1
amitchandak
Super User
Super User

@SIMMI , Are you looking something similar to this

Average of Rolling, Average of Snapshots: https://youtu.be/_pZRdLAJxxA

 

or join month summary with date table,

 

3 Month Avg = CALCULATE(AverageX(Values('Date'[MONTH Year]),calculate(Sum('Table'[Repair Time)))
,DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-3,MONTH))

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.