Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
mrzain14
Frequent Visitor

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

Screenshot 2024-02-13 074316.png

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@mrzain14 , 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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@mrzain14 , 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

@amitchandak 
Thank you so much,

It's working

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.