How to do it...

To implement this recipe, do the following:

  1. Create a column in the R06_Table tableĀ using the following formula:
Shift = 
VAR __1stBegin = 9
VAR __2ndBegin = 17
VAR __3rdBegin = 1
VAR __Time = TIMEVALUE('R06_Table'[Time])
VAR __Hour = HOUR(__Time)
RETURN
SWITCH(TRUE(),
__Hour >= __1stBegin && __Hour < __2ndBegin,"First",
__Hour >= __2ndBegin || __Hour < __3rdBegin,"Second",
"Third"
)