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

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.

Reply
Anonymous
Not applicable

Convert time to text with format hh:mm:ss

Hi

I'm new to PowerBi, and I'm trying to convert a time value (12:50:04) to a integer (125004). For this, I'm doing the following:

a) Converting the time to text

b) Replacing the : for (nothing)

c) Converting the text to integer.

 

The problem is that in step a), the conversion ignores the seconds, leaving a value like 12:50 and not 12:50:04 as expected.

In one of my tables it works.. but in the others not, not sure why. How can I solve this?

 

Thanks

1 ACCEPTED SOLUTION
Nathaniel_C
Super User
Super User

Hi @Anonymous ,

That is interesting! I received the same results, but what I did was change the time to date time first. Then you could delete first characters. 
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
NathanielTTT.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Nathaniel_C
Super User
Super User

Hi @Anonymous ,

That is interesting! I received the same results, but what I did was change the time to date time first. Then you could delete first characters. 
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
NathanielTTT.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




This was great, except when I went to convert the date time to text, it changed the time from 9:00AM to 8:59AM. It removed a second from all of the times?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.