cancel
Showing results for
Did you mean:
Highlighted
Post Patron

## convert minutes into hours minutes and seconds (Not Days)

Hi Community...Sombody could help me to modify a formula???...I found something that could help me but I need to modify it: As you see in the example, the result for "2527" minutes is "1 day 18:07:00" but what Im looking for is " 42:07:00"...hours.

Any Advice in how to modify this:

Format =
var dayNo=INT([Minutes]/1440)
var hourNo=INT(MOD([Minutes],1440)/60)
var minuteNO=MOD(MOD([Minutes],1440),60)
var secondNo=INT(([Minutes]-INT([Minutes]))*60)
return
dayNo&" day "&FORMAT(hourNo,"#00")&":"&FORMAT(minuteNO,"#00")&":"&FORMAT(secondNo,"#00")

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Solution Sage

## Re: convert minutes into hours minutes and seconds (Not Days)

```Format =
var hourNo=INT([Minutes]/60)
var minuteNO=MOD([Minutes],60)
var secondNo=INT(([Minutes]-INT([Minutes]))*60)
return
" day "&FORMAT(hourNo,"#00")&":"&FORMAT(minuteNO,"#00")&":"&FORMAT(secondNo,"#00")```

Hope it helps...

Ninter

8 REPLIES 8
Highlighted
Solution Sage

## Re: convert minutes into hours minutes and seconds (Not Days)

```Format =
var hourNo=INT([Minutes]/60)
var minuteNO=MOD([Minutes],60)
var secondNo=INT(([Minutes]-INT([Minutes]))*60)
return
" day "&FORMAT(hourNo,"#00")&":"&FORMAT(minuteNO,"#00")&":"&FORMAT(secondNo,"#00")```

Hope it helps...

Ninter

Highlighted
Post Patron

## Re: convert minutes into hours minutes and seconds (Not Days)

That was it!!!! thank you @Interkoubess

Highlighted
Post Patron

## Re: convert minutes into hours minutes and seconds (Not Days)

@Interkoubess, is there a way to sum the column you fix for me? PBI only accept text format for that new column...any advice would be so much appreciated!!! Thanks!

Highlighted
Solution Sage

## Re: convert minutes into hours minutes and seconds (Not Days)

What kind of sum do you want to have ( results) ?

Let me know and it will make a try

Ninter

Highlighted
Post Patron

## Re: convert minutes into hours minutes and seconds (Not Days)

Hi @Interkoubess, hope you are doing okey!, and yes I want to have results like I do in Excel...the problem is that Power BI doesnt recognize that column as a time or any other type but text... In the pic you can see the output Id like to have (Excel) below that you can see the error...any advice would be so very welcome!!!

Highlighted
Solution Sage

## Re: convert minutes into hours minutes and seconds (Not Days)

Could you please share sample data and not printscreen in order to conduct some tests...

But why don't you change the data type from text to date( time) for example and it could work...

Let me know.

Ninter

Highlighted
Post Patron

## Re: convert minutes into hours minutes and seconds (Not Days)

Hi Ninter!! hope you are doing great and enjoying the weekend !

In the excel file I have 2 dates and over PB I could get the result you helped me out the other day...but that column can not be switched from text (the way it is now) to date or time or number or anything PB doesnt allows it I guess...I could get a formula over excel and it works...but the idea is not includ any formula in excel I need all in PB. Let me see how I can get you the pbix. Can I send the pbix. to some e-mail of yours please?

Highlighted
Solution Sage

## Re: convert minutes into hours minutes and seconds (Not Days)

Yeah you can share you pbix file right here with ( dropbox, etc...) no critical (personal) data and I will make a try or you can send on my private profile.

Let me know.

Ninter

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

#### Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

#### Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors