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
Vanessa250919
Helper IV
Helper IV

Convert duration to whole number

Hi community,

 

I need help, I trie to convert a duration number to whole number but in my whole number a need durations in hours 

 

Exemple : 05:02 = 5 hours 

 

Capture.JPG

 

6 REPLIES 6
v-yiruan-msft
Community Support
Community Support

Hi @Vanessa250919 ,

Please try to create a calculated column with below formula supposed to duration field is Text type:

Hour = VALUE(LEFT('Table'[Duration],FIND(":",'Table'[Duration],1,0)-1))

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
camargos88
Community Champion
Community Champion

@Vanessa250919 ,

 

Capture.PNG



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

Proud to be a Super User!



Greg_Deckler
Super User
Super User

See this article that will demonstrate how to convert to seconds and from there you could convert to hours easily. https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler  I just read this post, but it's not the same problem . I don't have a duration whole number, it's my problem 🙂 Capture.JPG

OK @Vanessa250919  I'll get this right at some point, here is a duration to seconds converter: https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Sorry @Vanessa250919 I thought that article referenced this one:

https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.