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! Learn more

Reply
FatherTheWizard
Resolver I
Resolver I

Measure with year always 2018 but month according to calendar

Hi

 

I would like to fixed comparison to year 2018 and my granularity is monthly basis. I have measure called "sales" that is using Fact1 table. In other words, I would like to compare sales of January 2019 to January 2018, January 2020 to January 2018, January 2021 to January 2018, Feb 2019 to Feb 2018, Feb 2020 to Feb 2018 and so on.

 

Any suggestions? I have normal date table which is connected Fact1.

3 REPLIES 3
FatherTheWizard
Resolver I
Resolver I

My date calendar has date, "yearmonth", month, year and etc fields.

Anonymous
Not applicable

Hi @FatherTheWizard 

 

Try this in filter section Dateadd[2018,-1,year].

 

New MEasure 2019= Calculate(Sum(Sales),filter(Table,Dateadd[2018,1,year]))

New measure 2020=Calculate(Sum(Sales),filter(Table,Dateadd[2018,2,year]))

 

 

Thanks & regards,

Pravin Wattamwar

 

 

 

 

Hi

 

I would like to have three measures which I would use in my graph which would have Year+Month as X axis (2020/01; 2020/02...) and value in Y axis.

 

  •  Regular sales measusre:  "Sales = Calculate(Sum(Sales))".
  • -2018 Sales measure. I would like to have measure that is something like "Sales 2018 = Calculate(Sum(Sales);FILTER(date;dateyear="2018")" which would show always 2018 monthly figures .
  • Difference between the above two which would be something like this: "Dif to 2018 sales = [Sales] - [Sales 2018).

And this should work in a monthly basis so Sales 2018 should not show the total of 2018 for each month of 2018.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.