Forum Discussion
saur_dash
8 years agoNew Member
Calculate difference between two DateTime values in different rows
I'm so sorry if a similar question has been answered before, but I'm new to DAX and have been struggling to implement DAX measures I've found on this forum for calculating the difference between Date...
- 8 years ago
Hi saur_dash
You could try adding this calculated column to your table.
Duration = VAR MyLastDate = MINX( FILTER( 'Table1', 'Table1'[Invoice Number] = EARLIER('Table1'[Invoice Number]) && EARLIER('Table1'[Payment Status]) = "Captured" && 'Table1'[Payment Status] = "Authorised" ), 'Table1'[Event Date]) RETURN IF(MyLastDate<>BLANK(),FORMAT('Table1'[Event Date]- MyLastDate,"HH:MM:SS") )It will only show a value on rows with a status of "Captured", and the value will be the value in Hours, Mins and Seconds since the row from the same Invoice Number with a status of "Authorised"
Phil_Seamark
8 years agoMicrosoft Employee
HI saur_dash,
Your post was empty under Source: and Desired Output:, so can you reply and try again? :)
saur_dash
8 years agoNew Member
Thanks for your reply Phil,
Sorry about the error, I've fixed the images. Any help you could give would be greatly appreciated.