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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Convert text value to time value I get error

Hello!

 

I got a calculated column in a sharepoint list that shows "hh:mm" and i've made is exceed 24 hours. But now I got this problem in power bi when i'm trying to convert the coumn to time or date i get error when the value exceeds 24 hours 😞

 

Anyone got any ideas?

 

Left is text                         Right is time

exceed24hours.PNGexceed24hours2.PNG

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Based on your description, you can try to get the values of hours and minutes and convert them to the "whole number" data type, and then use the "IF" function to get the results you want. You can refer to this below:

1. Get the values of hours and minutes

hour = LEFT('Table'[Column1],2)
minute = RIGHT('Table'[Column1],2)

2. Convert to the "whole number" data type

test_datetype.PNG

3. Use "IF" function

time = IF('Table'[hour]<24&&'Table'[minute]<60,CONCATENATE('Table'[hour]&":",'Table'[minute]),"23:59:59") 

 

Best Regards,

Liang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
jthomson
Solution Sage
Solution Sage

In the context of time, 26 hours makes no sense as that's a day and two hours - you probably want to look at duration instead, or depending on what your end goal is on your report, convert it just into a count of minutes

Anonymous
Not applicable

I've tried duration too but it doesnt work. Can I somehow convert the "error" message that shows blank column in the reports to just say "23:59:59" or something instead?

Hi @Anonymous ,

Based on your description, you can try to get the values of hours and minutes and convert them to the "whole number" data type, and then use the "IF" function to get the results you want. You can refer to this below:

1. Get the values of hours and minutes

hour = LEFT('Table'[Column1],2)
minute = RIGHT('Table'[Column1],2)

2. Convert to the "whole number" data type

test_datetype.PNG

3. Use "IF" function

time = IF('Table'[hour]<24&&'Table'[minute]<60,CONCATENATE('Table'[hour]&":",'Table'[minute]),"23:59:59") 

 

Best Regards,

Liang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hello again! I got a second question now, i've made so I got seconds too now "hh:mm:ss". But I cant seem to extract it like in the solution above. I cant go above 2 steps in either right or left because it cant extract the ":" 😞 It says "Cannot convert value '01:01' of type Text to type Integer." Any idees?

 

Inställelstid=the text value I want to convert to time

Inställelsetiduträkning=the converted with RIGHT/LEFT columns. 

 

But as you see the converted column has the seconds in minutes and so on.

 

cantexract.png

Anonymous
Not applicable

Thank you! That worked perfectly 🙂

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors