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

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

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

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!

3 REPLIES 3
Frequent Visitor

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

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!

Solution Sage

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

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

## Helpful resources

Announcements

#### Power BI September 2023 Update

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

#### Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

#### 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!

#### 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
Top Kudoed Authors