Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello guys,
I need to add an integer to a datetime to get the final date (date time format)
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
Solved! Go to Solution.
New Time1 = MAX('Table'[Time]) + MAX('Table'[Integers])/24/60
Hi @ThiagoDuarte Try this.
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
Proud to be a Super User!
New column = [Start Date] + time(0,[Duration(Minute]), 0)
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
Proud to be a Super User!
Hi @ThiagoDuarte
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
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
Proud to be a Super User!
Hi @ThiagoDuarte ,
What if you did this with DAX not in PowerQuery?
Nathaniel
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
New Time1 = MAX('Table'[Time]) + MAX('Table'[Integers])/24/60
Hi @ThiagoDuarte Try this.
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
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
Proud to be a Super User!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
68 | |
53 | |
39 | |
33 |
User | Count |
---|---|
71 | |
63 | |
57 | |
49 | |
46 |