Forum Discussion

drogers1209's avatar
drogers1209
Regular Visitor
2 years ago

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

  • 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

    • drogers1209's avatar
      drogers1209
      Regular 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!

      VINDEFECT DATE TIMEDESCRIPTIONSHIFTWanted in the data set
      45678912/23/24 9:00 AMdamaged 2ANO
      34567892/25/24 2:00 AMdent 4BNO
      56789122/25/24 7:05 AMscratch 3AYES
      67891232/25/24 9:05 AMmissed processAYES
      98745612/25/24 11:05 AMdamaged 4AYES
      23456782/25/24 9:00 AMscratch 1AYES
      87654122/25/24 10:05 AMscratch 2AYES
      76543212/25/24 3:05 PMdent 8AYES
      91234562/25/24 10:05 PMtest partBYES
      78912342/26/24 1:15 AMunpluggedBYES
      65432192/26/24 3:05 AMTorque faultBYES
      89123452/26/24 4:05 AMwrong partBYES
      12345672/26/24 9:00 AMdamaged 1ANO
      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User
        They want to see the most recent "B" Shift and most recent completed "A" Shift.
        
        for example. the date is 2/26

        yes, 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?