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
adrianoramos520
New Member

Converting string ex. "117:50:00" into hours

Well. I have two collums with a start service and other with the date closed as pic below:

pic_example1.PNG

 

I inserted a new collumn with the code:

(h):mm:ss =
var Hora= QUOTIENT('Incidentes (2)'[Segundos],3600)
var Minut0= QUOTIENT('Incidentes (2)'[Segundos]-'Incidentes (2)'[var Hora]*3600,60)
var Segundo='Incidentes (2)'[Segundos]-'Incidentes (2)'[var Hora]*3600-'Incidentes (2)'[var Minuto]*60
return
CONCATENATE(CONCATENATE(CONCATENATE(CONCATENATE('Incidentes (2)'[var Hora],":"),'Incidentes (2)'[var Minuto]),":"),'Incidentes (2)'[var Segundos])
 
And I got the result I wanted but as "String" and I'm not able to convert it into hours. So I can't find the time average and others calculations I expected.
When I try to convert it I get the message: "Its not possible convert the value '117:50:0' type of String into Date".
 
pic_example2.PNG
 
What am I doing wrong? Could you please help me?
Thanks a lot. 
1 ACCEPTED SOLUTION
v-eachen-msft
Community Support
Community Support

Hi @adrianoramos520 ,

 

You could use "Split" feature to get total hours in query editor.

Here is my result and test file for your reference.

4-1.PNG

 

Community Support Team _ Eads
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

11 REPLIES 11

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.

Top Solution Authors
Top Kudoed Authors