Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
ThiagoDuarte
Helper I
Helper I

Add integer (minutes) to datetime

Hello guys,

 

I need to add an integer to a datetime to get the final date (date time format)

 

ThiagoDuarte_0-1638277622503.png

 

I have the start date column and the duration in minutes as an integer. I need datetime format as output (final date)

 

Any ideas on this?

 

Thanks,

Thiago

 

1 ACCEPTED SOLUTION

New Time1 = MAX('Table'[Time]) + MAX('Table'[Integers])/24/60

Hi @ThiagoDuarte Try  this.

Nathaniel_C_0-1638289357472.png

 



Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




View solution in original post

11 REPLIES 11
amitchandak
Super User
Super User

@ThiagoDuarte ,

New column = [Start Date] + time(0,[Duration(Minute]), 0)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

ThiagoDuarte_0-1638278507856.png

 

it doesn't work

 

the column duration minutes have values over 3000

 

Hi @ThiagoDuarte Try 

[Time]+#duration(0,0,[Integers],0)


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Hi @ThiagoDuarte hide.PNG

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




It does work but i cant use it with direct query.

 

i need a directquery solution

hi @ThiagoDuarte , you did not mention direct query in your  question...but you can you use Number.Mod(5, 3) = (2 as an example.) Divide the integers by 60, then the modulus by 60 until less than 60 etc.


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Hi @ThiagoDuarte ,
What if you did this with DAX not in PowerQuery?
Nathaniel





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

Proud to be a Super User!




That was my first tought.

 

I tried doing this on dax but i couldn't get it to work properly

var tap = reportfusion[Tap to Tap]  (this is a measure. it sums a few columns)

//inicial
var iniciohora = HOUR(MAX(reportfusion[start date]))
var iniciominuto = MINUTE(MAX(reportfusion[start date]))
var iniciodia = INT(MAX(reportfusion[start date]))
var iniciosegundo = SECOND(MAX(reportfusion[start date]))

//duração
var duracaohora = INT(divide(tap,60))
var duracaominuto = int(reportfusion[Tap to Tap])
var duracaodia = INT(DIVIDE(tap,1440))

//final
var finaldia = convert(iniciodia+duracaodia,DATETIME)
var finalhora = mod(iniciohora+duracaohora,24)+int(divide(duracaominuto,60))
var finalminuto = mod(iniciominuto+duracaominuto,60)

//data final
var dia = DATE(YEAR(finaldia),MONTH(finaldia),day(finaldia))
var hora = IF(LEN(finalhora)=1,0&finalhora,finalhora)
var minuto = IF(LEN(finalminuto)=1,0&finalminuto,finalminuto)

var datafinal = dia&" "&hora&":"&minuto&":"&iniciosegundo
return
datafinal

 

ThiagoDuarte_0-1638288042053.png

 

 

 

New Time1 = MAX('Table'[Time]) + MAX('Table'[Integers])/24/60

Hi @ThiagoDuarte Try  this.

Nathaniel_C_0-1638289357472.png

 



Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Ok. That worked beautifully 

 

I was overthinking about this hehe 😅

 

Thank you so much!

Hi @ThiagoDuarte 

I never do that!🤣


Nathaniel





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

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors