Forum Discussion
Time Filter for previous 2 shifts.
I am trying to create a filter/slicer that will show me data from the past 2 shifts at work. I cannot use the relative time feature because it is a rolling time and I need the entire previous two shifts. I can't calculate using days because the shifts span 2 different days.
Start time for Day shift = 7:00am
End time for Day shift = 5:40pm
Start time for Night shift = 7:30pm
End time for Night shift = 6:10 am
I have seen similar problems resolved but not my exact topic
8 Replies
- lbendlin
Super User
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- drogers1209Regular Visitor
Here is a sample table of data. The column on the far right "Wanted in the data set" shows the rows I want included in the data.
The Shifts at the company I work are 10 hours with some time in between them. Due to how they are scheduled the "B" Shift overlaps two different dates.
Start times:
A-Shift - 07:00am -> 5:40pm
B-Shift - 7:30pm -> 06:10am
the data I am trying to create a filter for is to be able to isolate the shifts so I can select which shifts I want to see. The normal use case I need is a last 2 shift example for management to review in the mornings. They want to see the most recent "B" Shift and most recent completed "A" Shift.
for example. the date is 2/26
I want to review the data from 2/25 "A" Shift and 2/25 "B" Shift. The 2/25 "B" Shift starts @ 7:30pm 2/25 and ends 06:10am 2/26
lbendlin let me know if this gives you what you need
Thanks!
VIN DEFECT DATE TIME DESCRIPTION SHIFT Wanted in the data set 4567891 2/23/24 9:00 AM damaged 2 A NO 3456789 2/25/24 2:00 AM dent 4 B NO 5678912 2/25/24 7:05 AM scratch 3 A YES 6789123 2/25/24 9:05 AM missed process A YES 9874561 2/25/24 11:05 AM damaged 4 A YES 2345678 2/25/24 9:00 AM scratch 1 A YES 8765412 2/25/24 10:05 AM scratch 2 A YES 7654321 2/25/24 3:05 PM dent 8 A YES 9123456 2/25/24 10:05 PM test part B YES 7891234 2/26/24 1:15 AM unplugged B YES 6543219 2/26/24 3:05 AM Torque fault B YES 8912345 2/26/24 4:05 AM wrong part B YES 1234567 2/26/24 9:00 AM damaged 1 A NO - lbendlin
Super User
They want to see the most recent "B" Shift and most recent completed "A" Shift. for example. the date is 2/26yes, but at what time are they looking at the report? What if they look at it at 6:40 am? What if they look at it at 6:00 pm?