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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
TotoBlank
Frequent Visitor

Compare periods: same month in 3 different years

Hello, 

 

I want to compare the totalized variables monthly for the last day of the month (i have date in the slicer) with the same month in 3 different years

EX: if i chose 31/10/2023, we shold have this :

TotoBlank_0-1673625175163.png

 

Thanks in advance.

 

2 REPLIES 2
adudani
Super User
Super User

hi @TotoBlank ,

 

you can with month on the x axis and a date filter, create 4 measures to compare the sum of the variable:

1. Measure: 

CurrentMontYear_Sum =

Var _SumVariable = Sum( FactTable[Column])

Var _EOMonth_CurrentYear_Sum = CALCULATE ( _SumVariable, EOMONTH( DateTable[DateColumn] , 0)
Return _EOMonth_CurrentYear_Sum

2. Measure: 

prevMontYear_Sum =

Var _SumVariable = Sum( FactTable[Column])

Var _EOMonth_PrevYear_Sum = CALCULATE ( _SumVariable, EOMONTH( DATEADD( DateTable[DateColumn], -1 ,Year) , 0)
Return _EOMonth_PrevYear_Sum

 

Create 2 more measures changing the -1 to -2 and -3 for prev years respectfully.

 

Appeciate a thumbs up if this is helpful.

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Hi @adudani,


Thank you for help, but it dosnt' realy work. This is the result once i create the measure with date filter :

TotoBlank_0-1673726335490.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors