The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I have this numbers as my time value and want to format to time value like hh:mm:ss in power query.
example 113, 1256, 211318, 144036, 2
expected 00:01:13, 00:12:56, 21:13:18, 14:40:36, 00:00:02
Solved! Go to Solution.
First change the type of your Column to "Text"
Then
Try this custom Column
Change ColName according to your actual Column Name
=let sec=Text.End([ColName], 2), min=Text.End( Text.BeforeDelimiter([ColName],sec),2), hour=Text.End( Text.BeforeDelimiter([ColName],min&sec) , 2) in #time( (if hour="" then 0 else Number.From(hour)), (if min="" then 0 else Number.From(min)), (if sec="" then 0 else Number.From(sec)))
First change the type of your Column to "Text"
Then
Try this custom Column
Change ColName according to your actual Column Name
=let sec=Text.End([ColName], 2), min=Text.End( Text.BeforeDelimiter([ColName],sec),2), hour=Text.End( Text.BeforeDelimiter([ColName],min&sec) , 2) in #time( (if hour="" then 0 else Number.From(hour)), (if min="" then 0 else Number.From(min)), (if sec="" then 0 else Number.From(sec)))
Sample file attached as well