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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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