Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

NEW date column based on condition

  Hi,  I have 2 dates column and I want to create  a new date column based on the Last PODdate and FirstPOD date.    The logic is as follows:  New PoDDateColumn= If the FirstPOD date has a value...
  • Anonymous's avatar
    Anonymous
    3 years ago

    I solved this problem on my own using a very simple trick. I trimmed the dates and then inserted null in the blanks. After inserting "null" in place blanks. I was able to get what I wanted. using the same coalesce function using ??

     

    = Table.AddColumn(#"Changed Type", "Final_PodDate", each [FirstPODDate]??[LastPODDate]) 

  • KNP's avatar
    KNP
    3 years ago

    Yep, which is why I said above, you'll need to convert blanks to nulls. 

    Glad you got it worked out.