Forum Discussion

Hepworthnot's avatar
Hepworthnot
Frequent Visitor
4 years ago
Solved

Dates in column not showing when apply DateAdd function

Hi,

 

I am trying to add either 0 or 1 days to a date depending on the content of the column called Offset.

 

Here is the formula:

 

NewColumn = DATEADD('TableName'[DateUTC],[Offset],day)
 
The formula works on some dates but other dates are left blank.
 
If I just copy the date with this formula - NewColumn = 'TableName'[DateUTC] then it copies over all of the dates and there are no blanks.
 
The data type of both columns is 'Date/time'
 
I would appreciate any ideas as to why I am getting some blank entries.
 
Thanks
Phil
  • Hi, Hepworthnot ,

    According to the offical document, The following formula calculates dates that are one day before the dates in the current context.

    If you want display every value. you could try it.

    NewColumn = 
    [DateUTC]+[Offset]

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

11 Replies

  • vanessafvg's avatar
    vanessafvg
    Icon for Community Champion rankCommunity Champion

    have you checked the value of both values ie DateUTC] and [Offset], i would pull both those columns into a matrix first.

     

     

    • Hepworthnot's avatar
      Hepworthnot
      Frequent Visitor

      vanessafvg 

       

      Thanks, 

       

      I have checked both columns. There are dates in all the cells of the [DateUTC] column and either 0 or 1 in each cell of the [Offset] column.

      • vanessafvg's avatar
        vanessafvg
        Icon for Community Champion rankCommunity Champion

         its one of those scenarios that its really hard to answer without seeing the data, are you able to share?  i would take both the columns and dump them in a table and matrix with the measure you are creating and see which rows product the blank value.

  • Hepworthnot's avatar
    Hepworthnot
    Frequent Visitor

    Hi vanessafvg,

     

    thank you for helping.

     

    Would you mind pointing me in the direction of instructions on how to create a matrix please.

     

    There is data in both the [DateUTC] and [Offset] columns.

     

    Thank you

  • v-yalanwu-msft's avatar
    v-yalanwu-msft
    Icon for Community Support rankCommunity Support

    Hi, Hepworthnot ,

    According to the offical document, The following formula calculates dates that are one day before the dates in the current context.

    If you want display every value. you could try it.

    NewColumn = 
    [DateUTC]+[Offset]

    The final show:


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.