Forum Discussion

m_roussakis's avatar
m_roussakis
Icon for Helper III rankHelper III
2 years ago
Solved

Looking to subtract time from a date.Time column in Power Query

I have this formula :

 

new column = if [EVT_CD] = "TF" then [EVT_TMSTMP] - #duration(0, 1, 0) else [EVT_TMSTMP]

but it gives me an error in new column.

My [EVT_TMSTMP] column is in Date/Time format, and looks like this:

 


Can anyone fix my formula so I dont get an error when a TF record is found?

  • Your mention of requiring 4 parameters jogged my memory and i was able to fix this. Thanks!

    = if [EVT_CD] = "TF" then [EVT_TMSTMP] - #duration(0, 0, 1, 0) else [EVT_TMSTMP]

2 Replies

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

    Please, if you get an error and want help you really have to post the error message.  Also, Duration takes 4 parameters

  • Your mention of requiring 4 parameters jogged my memory and i was able to fix this. Thanks!

    = if [EVT_CD] = "TF" then [EVT_TMSTMP] - #duration(0, 0, 1, 0) else [EVT_TMSTMP]