Forum Discussion

jhaldane's avatar
jhaldane
Frequent Visitor
8 years ago
Solved

Group Days and create shifts

Please can you assist me (step by step) Please can you show me how to group into days and then create three shifts. i.e. I have many rows for the 1st May all with different times. Then group times ...
  • v-yulgu-msft's avatar
    8 years ago

    Hi jhaldane,

     

    Month = Test_3[Dates].[MonthNo]
    
    Day = Test_3[Dates].[Day] 
    
    Time = FORMAT(Test_3[Dates] ,"hh:mm:ss")
    
    Shift =
    IF (
        Test_3[Time] >= TIME ( 6, 0, 0 )
            && Test_3[Time] < TIME ( 14, 0, 0 ),
        "Shift1",
        IF (
            Test_3[Time] >= TIME ( 14, 0, 0 )
                && Test_3[Time] < TIME ( 22, 0, 0 ),
            "Shift2",
            "Shift3"
        )
    )
    

     

    Best regards,

    Yuliana Gu