Forum Discussion

pnem's avatar
pnem
Frequent Visitor
3 years ago
Solved

SAMEPERIODLASTYEAR over multiple year

Hello
I would like to know if is there a function that resembles SAMEPERIODLASTYEAR but that can be expanded to more than one year back? Like the average of a monthly value for the same month the last five years?
Thanks!

  • pnem 

     

    you can use DATEADD, just change the number of intervals you want to go back

     

    Measure = CALCULATE(
        [Sales amt],
       DATEADD(Date_Table[Date],-2,YEAR
    ))

2 Replies

  • pnem 

     

    you can use DATEADD, just change the number of intervals you want to go back

     

    Measure = CALCULATE(
        [Sales amt],
       DATEADD(Date_Table[Date],-2,YEAR
    ))