Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
m_roussakis
Helper III
Helper III

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:

m_roussakis_0-1702588523730.png

 


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

1 ACCEPTED SOLUTION
m_roussakis
Helper III
Helper III

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]

View solution in original post

2 REPLIES 2
m_roussakis
Helper III
Helper III

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]

HotChilli
Super User
Super User

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.