cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FerChavirock
Frequent Visitor

Creating a Shift Column Based of Date/Time

I have a column "TIME_STAMP" and I want to assign shifts based on the following time ranges:

"1er." = 6:00:00-15:29:59, "2do." = 15:30:00-23:53:59, "3er." = 23:54:00-5:59:59

FerChavirock_0-1623864063693.png

 

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @FerChavirock

 

It works well in my environment, please check the data type.

vxulinmstf_0-1624264361304.png

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

 

View solution in original post

4 REPLIES 4
v-xulin-mstf
Community Support
Community Support

Hi @FerChavirock

 

It works well in my environment, please check the data type.

vxulinmstf_0-1624264361304.png

 

If you still have some question, please don't hesitate to let me known.‌‌

 

Best Regards,

Link

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

 

View solution in original post

it worked well, thanks a lot!!!

PaulOlding
Solution Supplier
Solution Supplier

You could add a calculated column with this DAX:

Shift =
SWITCH(TRUE(),
'Time (to Seconds)'[Time] < TIME(6,0,0), "3er",
'Time (to Seconds)'[Time] < TIME(15,30,0), "1er",
'Time (to Seconds)'[Time] <= TIME(23,59,59), "2do",
"3er")

PaulOlding_1-1623870810072.png

 

 

I added the column but the result is not as expected

TURNO1 = SWITCH(

TRUE(),

HOURLY_OUTPUT_CURRENT[TIME_STAMP] < TIME(6,0,0), "3RO",

HOURLY_OUTPUT_CURRENT[TIME_STAMP] < TIME(15,30,0), "1RO",

HOURLY_OUTPUT_CURRENT[TIME_STAMP] <= TIME(23,53,59), "2DO",

"OTHER")

FerChavirock_2-1623883585210.png

any idea what could be wrong?

 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Top Kudoed Authors