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
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
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.