Forum Discussion
Syndicate_Admin
Administrator
4 years agoI calculate in hours between two different record dates
Good morning community, I would need the following help. Currently I have different order numbers and in the factory they would need to know the difference in hours between the end of one order a...
tamerj1
Community Champion
4 years agoHi Syndicate_Admin
Here is a sample file with the solution https://www.dropbox.com/t/xt1mFlBtHgSNF5Ur
Time =
VAR CurrentStart= Orders[Start Date]
VAR PreviousEnd = MAXX ( FILTER ( Orders, Orders[End Date] < CurrentStart ), Orders[End Date] )
VAR TimeDifference = DATEDIFF ( PreviousEnd, CurrentStart, MINUTE )
RETURN
IF ( NOT ISBLANK ( PreviousEnd ), DIVIDE ( TimeDifference, 60 ) )