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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.