Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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 .
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
7 | |
2 | |
2 | |
2 |
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |