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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors