none
DATEADD Bug?

    Question

  • Hello,

    I have used the following code in excel 2013 Powerpivot :

    =DATEADD(Table1[Date], -2, month)

    Date DateAdd-2Mths
    28/12/2013
    28/1/2014
    28/2/2014 28/12/2013
    28/3/2014 28/1/2014
    28/4/2014 28/2/2014
    28/5/2014 28/3/2014
    28/6/2014 28/4/2014
    28/7/2014 28/5/2014
    28/8/2014 28/6/2014
    28/9/2014 28/7/2014
    28/10/2014 28/8/2014
    28/11/2014 28/9/2014
    28/12/2014 28/10/2014

    Might this be a bug? Thanks.

    Saturday, February 15, 2014 8:16 AM

Answers

  • Hi TKH_PowerPivot,

    Does the Table1[Date] column contain all dates between 1/1/2013 and 31/12/14? If not, this will be the reason behind this issue. That is to say, the DATEADD() function can only shift the date as far back (or forward) as the dates you have in this column.


    Regards,

    Michael

    Please remember to mark a post that answers your question as an answer...If a post doesn't answer your question but you've found it helpful, please remember to vote it as helpful :)

    Saturday, February 15, 2014 9:21 AM

All replies

  • I could not understand your question:

    Please try the below?

    Select DATEADD(month,-2,'12/28/2013')
    Select DATEADD(month,-2,'01/28/2013')

    Saturday, February 15, 2014 9:05 AM
  • Hi TKH_PowerPivot,

    Does the Table1[Date] column contain all dates between 1/1/2013 and 31/12/14? If not, this will be the reason behind this issue. That is to say, the DATEADD() function can only shift the date as far back (or forward) as the dates you have in this column.


    Regards,

    Michael

    Please remember to mark a post that answers your question as an answer...If a post doesn't answer your question but you've found it helpful, please remember to vote it as helpful :)

    Saturday, February 15, 2014 9:21 AM