Forum Discussion

Tarun-Bhatia's avatar
Tarun-Bhatia
Regular Visitor
6 years ago
Solved

Creating a Shift Column from Date-Time

Hi There   Need help in creating Shift column in PowerBi Desktop using Date-Time(READY_DATETIME) column. Shift 1: 6am - 2pm Shift 2: 2pm - 10pm Shift 3: 10pm - 6am       Any help would...
  • amitchandak's avatar
    6 years ago

    @Tarun-Bhatia ,

    Try a new column as

    New column ?
    var _hr á hour([readydatetime])
    Return
    switch(True(),
    _hr<6 && _hr >22 , "Shift 3",
    _hr < 14 , "Shift 2",
    "Shift 1"
    )