March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello,
I am trying to convert run_duration (DD: HH: MM: SS) column to Seconds.
For example, if Run duration is 1 Day: 1 hour: 1 minute: 1 second I need to convert it to 90061 seconds
86400 + 3600 + 60 + 1 = 90061.
Thanks
Solved! Go to Solution.
Seconds = VAR DurationString = SUBSTITUTE(Durations1[Duration], ":", "|") VAR Days = PATHITEM(DurationString,1) VAR Hours = PATHITEM(DurationString,2) VAR Minutes = PATHITEM(DurationString,3) VAR Seconds = PATHITEM(DurationString,4) RETURN Days * 86400 + Hours * 3600 + Minutes * 60 + Seconds
Seconds = VAR DurationString = SUBSTITUTE(Durations1[Duration], ":", "|") VAR Days = PATHITEM(DurationString,1) VAR Hours = PATHITEM(DurationString,2) VAR Minutes = PATHITEM(DurationString,3) VAR Seconds = PATHITEM(DurationString,4) RETURN Days * 86400 + Hours * 3600 + Minutes * 60 + Seconds
@smoupre wrote:
Seconds = VAR DurationString = SUBSTITUTE(Durations1[Duration], ":", "|") VAR Days = PATHITEM(DurationString,1) VAR Hours = PATHITEM(DurationString,2) VAR Minutes = PATHITEM(DurationString,3) VAR Seconds = PATHITEM(DurationString,4) RETURN Days * 86400 + Hours * 3600 + Minutes * 60 + Seconds
Wow, it is really tricky to use PATHITEM to get the substrings. Awesome work .
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
7 | |
3 | |
2 | |
1 | |
1 |
User | Count |
---|---|
8 | |
3 | |
2 | |
2 | |
2 |