cancel
Showing results for 
Search instead for 
Did you mean: 
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
Solution Sage
Solution Sage

>> 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
Solution Sage
Solution Sage

>> 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
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors