Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I need to convert seconds into day hours min sec. How can I do it?
Solved! Go to Solution.
Preferably in Power Query. e.g.:
let Source = #table(type table[Seconds = Int64.Type],{{4000},{40000},{100000},{1000000}}), Day = Table.AddColumn(Source, "Day", each Number.IntegerDivide([Seconds],24*60*60), Int64.Type), Hours = Table.AddColumn(Day, "Hours", each Number.Mod(Number.IntegerDivide([Seconds],60*60),24), Int64.Type), Min = Table.AddColumn(Hours, "Min", each Number.Mod(Number.IntegerDivide([Seconds],60),60), Int64.Type), Sec = Table.AddColumn(Min, "Sec", each Number.Mod([Seconds],60), Int64.Type) in Sec
or otherwise in DAX:
DAXDay = INT(Query1[Seconds]/(24*60*60)) DAXHours = MOD(INT(Query1[Seconds]/(60*60)),24) DAXMin = MOD(INT(Query1[Seconds]/60),60) DAXSec = MOD( Query1[Seconds],60)
Preferably in Power Query. e.g.:
let Source = #table(type table[Seconds = Int64.Type],{{4000},{40000},{100000},{1000000}}), Day = Table.AddColumn(Source, "Day", each Number.IntegerDivide([Seconds],24*60*60), Int64.Type), Hours = Table.AddColumn(Day, "Hours", each Number.Mod(Number.IntegerDivide([Seconds],60*60),24), Int64.Type), Min = Table.AddColumn(Hours, "Min", each Number.Mod(Number.IntegerDivide([Seconds],60),60), Int64.Type), Sec = Table.AddColumn(Min, "Sec", each Number.Mod([Seconds],60), Int64.Type) in Sec
or otherwise in DAX:
DAXDay = INT(Query1[Seconds]/(24*60*60)) DAXHours = MOD(INT(Query1[Seconds]/(60*60)),24) DAXMin = MOD(INT(Query1[Seconds]/60),60) DAXSec = MOD( Query1[Seconds],60)
Thanks! Got it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
117 | |
104 | |
77 | |
73 | |
50 |
User | Count |
---|---|
145 | |
109 | |
108 | |
90 | |
64 |