Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have a data set that shows Job Report Dates.
I want to calculate basically someone's shift. For the EndofShift I used the Max Job Report Date/Time and then for the BeginningofShift I used the Min Job Report Date/Time. When I do a DateDiff, the data is correct ONLY IF the employee works a shift in the same day.
We have overnight employees who work, let's say 10pm-6am, and the formula will give a value that isn't 8 hours.
Is there a way to remedy this? I'm using a dynamic date slicer to pick individual days to show the Shift Length
Solved! Go to Solution.
You can just have the EndTime subtract StartTime. The result is calculated in days. To get hours, just multiply by 24.
You can also do it with Power Query.
Or you can write an expression like:
=Duration.Hours(Duration.From([EndTime]-[StartTime]))
Regards,
You can just have the EndTime subtract StartTime. The result is calculated in days. To get hours, just multiply by 24.
You can also do it with Power Query.
Or you can write an expression like:
=Duration.Hours(Duration.From([EndTime]-[StartTime]))
Regards,
With the duration.hours, How do I make it not respond -16 when the hours are 4pm to 12am which should be 8
Can you provide some sample data? Specifically, is it a Date/Time column that has the date and the time? What interval are you using for your DATEDIFF?
User | Count |
---|---|
85 | |
79 | |
64 | |
52 | |
46 |
User | Count |
---|---|
101 | |
49 | |
42 | |
39 | |
38 |