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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
liboyjoseph
Frequent Visitor

Same period compare to a specific year

Hi team

Need your help on this please.

 

I want to create a mesure to compare same period to 2019. instead of same period last year, I need same period 2019. 

I've below measure and it works fine when my current date selection is on 2022, I want to compare all my dates to 2019.
 
Y3 = CALCULATE([Total Sales TY],DATEADD('Date'[Date], -3, YEAR)) 
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@liboyjoseph , if you always was 2019

 

Y3 =

var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )

//or var _diff = 2019 - year(maxx(allselected('Date'), 'Date'[date]) ))

return

CALCULATE([Total Sales TY],DATEADD('Date'[Date], _diff , YEAR))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
liboyjoseph
Frequent Visitor

Thank you @amitchandak Your solution work perfectly

amitchandak
Super User
Super User

@liboyjoseph , if you always was 2019

 

Y3 =

var _diff = 2019 - maxx(allselected('Date'), 'Date'[Year]) )

//or var _diff = 2019 - year(maxx(allselected('Date'), 'Date'[date]) ))

return

CALCULATE([Total Sales TY],DATEADD('Date'[Date], _diff , YEAR))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi, I want to make a measure to compare every last 4 year to 2017, same period. 2017 is my reference year to calculate an evolution for 2018, 2019, 2020 ...   

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.