Forum Discussion
Group Days and create shifts
- 8 years ago
Hi jhaldane,
Month = Test_3[Dates].[MonthNo] Day = Test_3[Dates].[Day] Time = FORMAT(Test_3[Dates] ,"hh:mm:ss") Shift = IF ( Test_3[Time] >= TIME ( 6, 0, 0 ) && Test_3[Time] < TIME ( 14, 0, 0 ), "Shift1", IF ( Test_3[Time] >= TIME ( 14, 0, 0 ) && Test_3[Time] < TIME ( 22, 0, 0 ), "Shift2", "Shift3" ) )Best regards,
Yuliana Gu
Hi jhaldane,
Month = Test_3[Dates].[MonthNo]
Day = Test_3[Dates].[Day]
Time = FORMAT(Test_3[Dates] ,"hh:mm:ss")
Shift =
IF (
Test_3[Time] >= TIME ( 6, 0, 0 )
&& Test_3[Time] < TIME ( 14, 0, 0 ),
"Shift1",
IF (
Test_3[Time] >= TIME ( 14, 0, 0 )
&& Test_3[Time] < TIME ( 22, 0, 0 ),
"Shift2",
"Shift3"
)
)
Best regards,
Yuliana Gu
- jhaldane8 years agoFrequent Visitor
Thank you so much for responding.
Some questions on below.
I have managed to add the columns for month and time.
Please can you assist me with the column for 'shift'?
Where do i type in the formula for Shift?
What measure should the shift column be in?
Thanks
Jerry
Month = Test_3[Dates].[MonthNo] Day = Test_3[Dates].[Day] Time = FORMAT(Test_3[Dates] ,"hh:mm:ss")
- v-yulgu-msft8 years ago
Microsoft Employee
Hi jhaldane,
For all above formulas in my original post, you should type them into calculated columns via clicking the highlighted button.
Create the calculated column: Month, Day and Time one by one. Then, remember to set the data type of [Time] field, as I mentioned in original post. After that, you can create the calculated column [Shift].
Regards,
Yuliana Gu
- ncav367 years agoNew Member
Hi, this does not work for me. I have been trying this for about 30 minutes, and it continues to give me an error "cannot convert value " of type Text to type Date" when I try to convert the text to "time" as displayed in your example. Can you help? I've done EXACTLY what you've suggested here. Thanks.
- ncav367 years agoNew Member
Hi, this did not work for me as I continue to get an error that states operations do not support comparing values of type Text with values of type Date. It says to consider using the Value or Format function to convert. But then when I convert the Time column as you have suggested, it also gives me an error that says "Cannot covert value " of type Text to type Date". Please help, I've done exactly what you've suggested and I cannot get it to work.