Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Martijn2
Frequent Visitor

Time registration as 330 while 03:30:00 is needed

 

Hello all,

Anyone tips on how I can get this timestamp to for example 03:30:00?

101 = 1:01

10:10 = 1010

 

Martijn2_1-1732185873014.png

 

 

1 ACCEPTED SOLUTION

@Martijn2 ok, try to put this code in a custom column:

let
TidAsText = Text.From([Tijd]),
TidLength = Text.Length(TidAsText),
Result =
if TidLength = 1 then
Time.FromText("0" & TidAsText & ":00:00")
else if TidLength = 2 then
Time.FromText("00:" & TidAsText & ":00")
else if TidLength = 3 then
Time.FromText("0" & Text.Start(TidAsText, 1) & ":" & Text.End(TidAsText, 2) & ":00")
else
Time.FromText(Text.Start(TidAsText, 2) & ":" & Text.End(TidAsText, 2) & ":00")
in
Result

 

BeaBF_0-1732203106216.png

 

 

BBF

View solution in original post

6 REPLIES 6
AlienSx
Super User
Super User

(x) => Time.FromText(Text.PadStart(x, 4, "0"), [Format = "hhmm"])
saurabhtd
Resolver II
Resolver II

@Martijn2 You can achieve this by adding custom column in table. Use below formula for creating column timestamp format. 

= if Text.Length([Tijd]) = 3 then 
    Text.PadStart(Text.Left([Tijd],1), 2, "0") & ":" & Text.Right([Tijd],2) & ":00" 
else 
    Text.Left([Tijd],2) & ":" & Text.Right([Tijd],2) & ":00"



BeaBF
Super User
Super User

@Martijn2 Hi!

Add a custom column with this code:

 

Time.FromText(Text.Start(Text.PadStart(Text.From([Tijd]), 4, "0"), 2) & ":" & Text.End(Text.PadStart(Text.From([Tijd]), 4, "0"), 2) & ":00")

 

BeaBF_0-1732187759262.png

 

please accept the answer as solution if it's ok!

 

BBF

This one works well, but only facing the following issues;

 

If it is 1:00 its described as 1. But the systems gets it as 00:01:00

Martijn2_0-1732202742003.png

Martijn2_1-1732202794918.png

 

 

@Martijn2 ok, try to put this code in a custom column:

let
TidAsText = Text.From([Tijd]),
TidLength = Text.Length(TidAsText),
Result =
if TidLength = 1 then
Time.FromText("0" & TidAsText & ":00:00")
else if TidLength = 2 then
Time.FromText("00:" & TidAsText & ":00")
else if TidLength = 3 then
Time.FromText("0" & Text.Start(TidAsText, 1) & ":" & Text.End(TidAsText, 2) & ":00")
else
Time.FromText(Text.Start(TidAsText, 2) & ":" & Text.End(TidAsText, 2) & ":00")
in
Result

 

BeaBF_0-1732203106216.png

 

 

BBF

shafiz_p
Super User
Super User

Hi @Martijn2 
First change the column type from text to whole number.


Try below code in power query custom column:

 

=Text.PadStart(Text.From(Number.RoundDown([AB Tijd] / 100)), 2, "0") & ":" & Text.PadStart(Text.From(Number.Mod([AB Tijd], 100)), 2, "0") & ":00"

 

 

Output:

shafiz_p_0-1732187565224.png

 

 

Hope this helps!!

If this solved your problem, please accept it as a solution and a kudos!!

 

Best Regards,
Shahariar Hafiz

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.