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
hetal247
Frequent Visitor

Convert hh:mm to decimals

Hi,

 

I have been looking for some help online but not getting there answer to my query.

 

I want to convert time into decimals. I know you can do this in excel by multiplying the time by 24 and format the cell to decimal number but this logic does not work in Power BI.

 

How do you convert 01:30 to 1.5 so i works for all time formats i.e 00:12 to 0.2, 00:30 to 0.5

 

I am looking to convert visit duration that is currently displayed in time format to decimal number and then want to sum the total duration for any given week.

 

Any help is much appreciated.

 

kind regards

 

Hetal

2 ACCEPTED SOLUTIONS
Mahesh0016
Super User
Super User

>> create Column
Column 2 = HOUR([Column])+MINUTE([Column])/60+SECOND([Column])/60/60 

Mahesh0016_0-1671712065620.png

 


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

View solution in original post

NikhilChenna
Continued Contributor
Continued Contributor

Hi @hetal247 ,

 

I think the by creating this below custom column your issue will get resolved,

 

Decimal column = HOUR([Datetime])+MINUTE([Datetime])/60+SECOND([Datetime])/60/60

 

 

Regards, 
Nikhil Chenna 


Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

View solution in original post

3 REPLIES 3
hetal247
Frequent Visitor

@NikhilChenna @Mahesh0016 

 

thank you both. this worked and does what i was after.

NikhilChenna
Continued Contributor
Continued Contributor

Hi @hetal247 ,

 

I think the by creating this below custom column your issue will get resolved,

 

Decimal column = HOUR([Datetime])+MINUTE([Datetime])/60+SECOND([Datetime])/60/60

 

 

Regards, 
Nikhil Chenna 


Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Mahesh0016
Super User
Super User

>> create Column
Column 2 = HOUR([Column])+MINUTE([Column])/60+SECOND([Column])/60/60 

Mahesh0016_0-1671712065620.png

 


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

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.