Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
I want to convert an INT feild(Time Spent On Calls In secs ) in a matrix table to hh:mm:ss format ,how to do that ?
Solved! Go to Solution.
@Anonymous
Refer to these posts.
https://community.powerbi.com/t5/Desktop/Seconds-to-HH-MM-SS/td-p/348817
If it helps, mark it as a solution
Kudos are nice too
Hi @Anonymous ,
If you want to convert second to hh:mm:ss, I think you could refer to above links to convert it. If you are using measure, you also could try below to achieve this goal
measure =
VAR hours =
ROUNDDOWN ( [measure] / 3600, 0 )
VAR minutes =
ROUNDDOWN ( MOD ( [measure], 3600 ) / 60, 0 )
VAR seconds =
INT ( MOD ( [measure], 60 ) )
VAR milliseconds =
round(MOD ( [measure], 1 ) * 100,0)
RETURN
FORMAT(hours,"00") & ":"
& FORMAT(minutes, "00")
& ":"
& FORMAT(seconds, "00")
& "."
& FORMAT(milliseconds, "00")
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @Anonymous
if you need a solution in Power Query, this concept would work out
let
Source = #table({"Time_Spent_On_Calls"}, {{"15292"}, {"16163"}}),
ChangedType = Table.TransformColumnTypes(Source,{{"Time_Spent_On_Calls", Int64.Type}}),
AddDays = Table.AddColumn(ChangedType, "GetDays", each [Time_Spent_On_Calls]/60/60/24, type number ),
AddedDuration = Table.AddColumn(AddDays, "Duration", each Duration.From([GetDays])),
AddedHHMMSS = Table.AddColumn(AddedDuration, "hh:mm:ss", each Text.From(Number.RoundDown (Duration.TotalHours([Custom])))&":"&Text.From(Duration.Minutes([Custom]))&":"&Text.From(Duration.Seconds([Custom])))
in
AddedHHMMSS
Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello @Anonymous
if you need a solution in Power Query, this concept would work out
let
Source = #table({"Time_Spent_On_Calls"}, {{"15292"}, {"16163"}}),
ChangedType = Table.TransformColumnTypes(Source,{{"Time_Spent_On_Calls", Int64.Type}}),
AddDays = Table.AddColumn(ChangedType, "GetDays", each [Time_Spent_On_Calls]/60/60/24, type number ),
AddedDuration = Table.AddColumn(AddDays, "Duration", each Duration.From([GetDays])),
AddedHHMMSS = Table.AddColumn(AddedDuration, "hh:mm:ss", each Text.From(Number.RoundDown (Duration.TotalHours([Custom])))&":"&Text.From(Duration.Minutes([Custom]))&":"&Text.From(Duration.Seconds([Custom])))
in
AddedHHMMSS
Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
@Anonymous
Refer to these posts.
https://community.powerbi.com/t5/Desktop/Seconds-to-HH-MM-SS/td-p/348817
If it helps, mark it as a solution
Kudos are nice too
my problem is i have duration in seconds column in a table and i am doing the sum of the column per user name and showing it in the matrix table , but my client wants this to show it as hh:mm:ss format , which i am not able to do it
Hi @Anonymous ,
If you want to convert second to hh:mm:ss, I think you could refer to above links to convert it. If you are using measure, you also could try below to achieve this goal
measure =
VAR hours =
ROUNDDOWN ( [measure] / 3600, 0 )
VAR minutes =
ROUNDDOWN ( MOD ( [measure], 3600 ) / 60, 0 )
VAR seconds =
INT ( MOD ( [measure], 60 ) )
VAR milliseconds =
round(MOD ( [measure], 1 ) * 100,0)
RETURN
FORMAT(hours,"00") & ":"
& FORMAT(minutes, "00")
& ":"
& FORMAT(seconds, "00")
& "."
& FORMAT(milliseconds, "00")
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |