Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Create Production Shift Category base on time stamp data

Hello,

 

Please help me to define production team category in Power BI.

I have a timestamp table data entry and want to create a category to filter different outputs each shift.

I have attached the rules to define the category:

 

Notes: I have difficulties making different conditions when example: the night shift production date 02/12 7 pm - 02/13 7 am,
when I want to see the production night shift on 02/13 7 pm - 02/14 7 am, data from 02/13 12 am - 02/13 7 am is still included.

 

I hope there is some solution for this case

  • Anonymous , Based on what I got.

     

    You can create a new column

    Time bucket =

    Switch( True() ,

    timevalue([Datetime]) >= time(7,0,0)  && timevalues([Datetime]) < time(19,0,0)  , "Day Shift",

    "Night Shift"

    )

     

    Date column to use

    Date =

    Switch( True() ,

    timevalues([Datetime]) < time(7,0,0)  , datevalue([Datetime])  -1,

    datevalue([Datetime]) 

    )

     

    This will give you date and shift to be used

2 Replies

  • Anonymous , Based on what I got.

     

    You can create a new column

    Time bucket =

    Switch( True() ,

    timevalue([Datetime]) >= time(7,0,0)  && timevalues([Datetime]) < time(19,0,0)  , "Day Shift",

    "Night Shift"

    )

     

    Date column to use

    Date =

    Switch( True() ,

    timevalues([Datetime]) < time(7,0,0)  , datevalue([Datetime])  -1,

    datevalue([Datetime]) 

    )

     

    This will give you date and shift to be used