Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Sign up nowGet Fabric certified for FREE! Don't miss your chance! Learn more
Good Morning All,
I think I'm overcomplicating here but I'm struggling to create a calculated column to identify "Work Shift" by looking at the hours of the day.
I have my times split into a single column.
I need one column that looks at the times and displays what shift that falls under.
0600AM to 0200PM = "Days"
0201PM to 1000PM = "Afternoons"
1001PM to 0559AM = "Midnights"
Any help is greatly appreciated.
Nick
Solved! Go to Solution.
Hi @NekoGTz ,
The basic syntax for your new column will be like this:
if [ReceivedTime.2] >= #time(06, 00, 00) and [ReceivedTime.2] < #time(14, 00, 00) then "Days"
else ...etc
Pete
Proud to be a Datanaut!
Hi @NekoGTz ,
The basic syntax for your new column will be like this:
if [ReceivedTime.2] >= #time(06, 00, 00) and [ReceivedTime.2] < #time(14, 00, 00) then "Days"
else ...etc
Pete
Proud to be a Datanaut!
Pete - Can't thank you enough! I've been scratching my head for days with incorrect time format.
Final statement is: (and works perfectly)
if [ReceivedTime.2] >= #time(06, 00, 00) and [ReceivedTime.2] < #time(14, 00, 00) then "Days" else if [ReceivedTime.2] >= #time(14, 01, 00) and [ReceivedTime.2] < #time(22, 00, 00) then "Afternoons" else "Midnights"
Hi @NekoGTz ,
Glad this got you sorted.
You just need to adjust your second line to the following, otherwise you'll miss any times between 14:00:00 and 14:00:59 :
[ReceivedTime.2] >= #time(14, 00, 00) // changed to 14:00:00
Pete
Proud to be a Datanaut!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 12 | |
| 11 | |
| 11 | |
| 7 | |
| 6 |