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
christianfcbmx
Post Patron
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: 

 

THANKS IN ADVANCE!!!!!

 

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")

 

Cap 1.JPG

1 ACCEPTED SOLUTION
Interkoubess
Solution Sage
Solution Sage

Hi @christianfcbmx,

 

What about this formula:

 

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

View solution in original post

9 REPLIES 9
Interkoubess
Solution Sage
Solution Sage

Hi @christianfcbmx,

 

What about this formula:

 

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

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

How did you solve this issue?

Hi @christianfcbmx,

 

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

Let me know and it will make a try

 

Ninter

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

Consult.jpgiiiiiii.jpg

Hi @christianfcbmx,

 

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

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?

 

Thanks for your good will!!!!!!

Hi @christianfcbmx,

 

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 

That was it!!!! thank you @Interkoubess

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.