Forum Discussion

shaykoooo's avatar
shaykoooo
Helper I
8 years ago
Solved

PARALLELPERIOD vs DATEADD

Hi,
I would like to understand the difference between the two. Today is March 8th, 2018, so DATEADD ( 'Date'[Date], -1, YEAR ) ) would return the sales of last year but only from 1/1/2017 through March 8th, 2017? Whreas PARALLELPERIOD( 'Date'[Date], -1, YEAR ) ) would return sales from 1/1/2017 through March 30th, 2017? Am I correct in both statements?
If you can refer to sales on your answer, that would be great. ie for each function, sales for what periods will I receive?

TY
  • The PARALLELPERIOD function is similar to the DATEADD function except that PARALLELPERIOD always returns full periods at the given granularity level instead of the partial periods that DATEADD returns. For example, if you have a selection of dates that starts at June 10 and finishes at June 21 of the same year, and you want to shift that selection forward by one month then the PARALLELPERIOD function will return all dates from the next month (July 1 to July 31); however, if DATEADD is used instead, then the result will include only dates from July 10 to July 21.

  • What should happen is that the PARALLELPERIOD function would return all dates from the next month (July 1 to July 31) but DATEADD should only July 1 to July 21.

11 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    The PARALLELPERIOD function is similar to the DATEADD function except that PARALLELPERIOD always returns full periods at the given granularity level instead of the partial periods that DATEADD returns. For example, if you have a selection of dates that starts at June 10 and finishes at June 21 of the same year, and you want to shift that selection forward by one month then the PARALLELPERIOD function will return all dates from the next month (July 1 to July 31); however, if DATEADD is used instead, then the result will include only dates from July 10 to July 21.

    • shaykoooo's avatar
      shaykoooo
      Helper I
      And what if the period was from June 1 through June 21?
      • Greg_Deckler's avatar
        Greg_Deckler
        Community Champion

        What should happen is that the PARALLELPERIOD function would return all dates from the next month (July 1 to July 31) but DATEADD should only July 1 to July 21.