Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi !
Solved! Go to Solution.
You can copy the logic from my previous reply after the each-expression in the formula bar of that step
if [time_for_shift_segmentation] >= #time(6, 0, 0) and [time_for_shift_segmentation] < #time(15, 0, 0) then "Morning" else if [time_for_shift_segmentation] >= #time(15, 0, 0) and [time_for_shift_segmentation] < #time(23, 0, 0) then "Evening" else "Night"
Make sure to keep the closing parenthesis of the Table.AddColumn function.
Ps. If this helps solve your query please mark this post as Solution, thanks!
Hi @moshe_Arama2022,
You can add a conditional column for that. Note that above you'd included that both start and end time in a Shift therefore 15:00 would belong to Morning not Evening, I adjusted that below but you can change that of course.
Give something like this a go
AddShift = Table.AddColumn( PrevStepNameHere, "Custom", each
if [time_for_shift_segmentation] >= #time(6, 0, 0) and [time_for_shift_segmentation] < #time(15, 0, 0) then "Morning"
else if [time_for_shift_segmentation] >= #time(15, 0, 0) and [time_for_shift_segmentation] < #time(23, 0, 0) then "Evening"
else "Night",
type text
)
hi thank you !
its helps me
bay the way i have tried to use in conditional column but i didnt get what i need
You can copy the logic from my previous reply after the each-expression in the formula bar of that step
if [time_for_shift_segmentation] >= #time(6, 0, 0) and [time_for_shift_segmentation] < #time(15, 0, 0) then "Morning" else if [time_for_shift_segmentation] >= #time(15, 0, 0) and [time_for_shift_segmentation] < #time(23, 0, 0) then "Evening" else "Night"
Make sure to keep the closing parenthesis of the Table.AddColumn function.
Ps. If this helps solve your query please mark this post as Solution, thanks!