Forum Discussion
Calculate Time
How do I calculate total time between start time and stop time when my data is like this?
Once you examined the code, replace the Source step with your own source.
13 Replies
- lbendlinSuper User
does one event always finish before the other starts? No overlaps?
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523- tracyhopaulsonResolver I
The start and stop time for each day of each person is not always on the same row, I don't know how to get the total hrs for that person each day. How do I attach sample pbix file here?
- lbendlinSuper User
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
- AnonymousNot applicable
Hi tracyhopaulson ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create two slicer tables.
Start Time Slicer = VALUES('Table'[TimeStamp(PST)])Stop Time Slicer = VALUES('Table'[TimeStamp(PST)])(3) We can create a measure.
Time = DATEDIFF(MAX('Start Time Slicer'[TimeStamp(PST)]),MAX('Stop Time Slicer'[TimeStamp(PST)]),MINUTE)(4) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- tracyhopaulsonResolver I
Thank you for your feedback. Is it possible to have the measure calculate the total minutes from start to stop for each day without the slicers?