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
medzabad
New Member

Compare current year 3-month rolling average to last year's 3-month rolling average

This year's rolling calc works fine, but need to get average for same 3 month period last year.
 
Rolling  CALCULATE(AVERAGE(Census[Census]),DATESINPERIOD('DimDate'[Date],ENDOFMONTH(Census[CensusDate]),-3,MONTH))
 
Ultimate goal:  Need to get last year's 3-month rolling average, which I will then use to compare to this year's 3 month rollilng average to get a variance %, which I will then use that variance % to increase/decrease my current month, day, week, etc... 
 
Thanks in advance for your help!
1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

pls try

Rolling  3 last year = 
VAR _Last = DATEADD(
DATESINPERIOD('Calendar'[Date],ENDOFMONTH(Census[CensusDate]),-3,MONTH),-1,YEAR)
RETURN
CALCULATE(AVERAGE(Census[Census]),_Last)

View solution in original post

2 REPLIES 2
Ahmedx
Super User
Super User

pls try

Rolling  3 last year = 
VAR _Last = DATEADD(
DATESINPERIOD('Calendar'[Date],ENDOFMONTH(Census[CensusDate]),-3,MONTH),-1,YEAR)
RETURN
CALCULATE(AVERAGE(Census[Census]),_Last)

Thanks much!  It works as expected!  😊

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.

Top Solution Authors