Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

DateAdd vs ParallelPeriod vs SamePeriodLastYea

I was looking for DateAdd vs ParallelPeriod vs SamePeriodLastYea and found this one: https://radacad.com/dateadd-vs-parallelperiod-vs-sameperiodlastyear-dax-time-intelligence-question   SamePerio...
  • v-lili6-msft's avatar
    7 years ago

    hi, Anonymous 

    The best understanding is that SamePeriodLastYea Function is the same this formula:

    DATEADD(dates, -1, year)

    As you can see, "The first difference is that ParallelPeriod gives you the option to go as many as intervals you want back or forward."

    and it couldn't be modified, so for their difference, it is the same between DATEADD(dates, -1, year) and ParallelPeriod.

    For example:

    For Q4 of 2006 SamePeriodLastYea will return Q4 of 2005, but ParallelPeriod (year) will return all 2005.

     

    Best Regards,

    LIN