Forum Discussion
Calculating time between 2 different columns
Hello,
I am sure this question has been asked million of times but I can't seem to find the solution and to be honest it is driving me insane.
I have two columns with time stamps in a Appended Data Query
| INVOICE CREATED | Next Start Time |
| 08:58:25 | 08:58:40 |
| 08:58:40 | 08:58:56 |
'Next Start Time' is a calculated column getting the next INVOICE CREATED time from the next row if the name of the person producing is the same.
Now this is where I am getting stuck I need another, calculated column showing the difference between the two times in hh:nn:ss
I have seen the posts where I can show the time in HOUR, MINUTES or SECONDS
But, it isn't what I need to show in the table visual, but (using the above table as an example )
| INVOICE CREATED | Next Start Time | PROCESSING TIME |
| 08:58:25 | 08:58:40 | 00:00:15 |
| 08:58:40 | 08:58:56 | 00:00:16 |
Any help would be greatly appreciated.
Have you tried taking a simple difference and setting the column type to Time?
'Appended Data'[Next Start Time] - Appended Data'[INVOICE CREATED]Note: If processing time can be longer than 24 hours, this might not be a good approach.
4 Replies
- AlexisOlsonSuper User
Have you tried taking a simple difference and setting the column type to Time?
'Appended Data'[Next Start Time] - Appended Data'[INVOICE CREATED]Note: If processing time can be longer than 24 hours, this might not be a good approach.
- RatsoFrequent Visitor
OMG!!😯
Thats done it... I have a tendency to over think things😶
Just out of interest... is there a better approach than doing it this way as I will have thousands of lines to add to this append. Should I be doing it in power query instead as a calculated column on the report
- AlexisOlsonSuper User
Power Query would indeed be a better practice.
Try using Duration.From([Next Start Time] - [INVOICE CREATED]).
- RatsoFrequent Visitor
Many thanks, will give it a go 😃