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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.