Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Would like to know if how will I make a column for the equivalent shift of the given time
1st Shift: 6am - 2pm
2nd Shift: 2pm - 10pm
3rd Shift: 10pm - 6am
Thank you
Solved! Go to Solution.
you can try this in PQ
=if DateTime.Time([Date]) >= #time(6, 0, 0) and DateTime.Time([Date]) < #time(14,0,0) then "1st Shift" else if DateTime.Time([Date]) >= #time(14,0,0) and DateTime.Time([Date]) <#time(22,0,0) then "2nd Shift" else "3rd Shift"
or create a DAX column
Proud to be a Super User!
Hi @Vonn
Alternatively you can create calculated column as below using TIME DAX functions:
Hi @Vonn
Alternatively you can create calculated column as below using TIME DAX functions:
you can try this in PQ
=if DateTime.Time([Date]) >= #time(6, 0, 0) and DateTime.Time([Date]) < #time(14,0,0) then "1st Shift" else if DateTime.Time([Date]) >= #time(14,0,0) and DateTime.Time([Date]) <#time(22,0,0) then "2nd Shift" else "3rd Shift"
or create a DAX column
Proud to be a Super User!