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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
@Anonymous
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 @Anonymous
Alternatively you can create calculated column as below using TIME DAX functions:
Hi @Anonymous
Alternatively you can create calculated column as below using TIME DAX functions:
@Anonymous
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!