Showing results for 
Search instead for 
Did you mean: 
New Member

Creating a shift model

I analyse user numbers, and I would like to divide the work day into early (6 am- 2 pm),  late (2 pm- 10 pm) and night shifts (10 pm- 6 am). Creating the night shift is no problem because it runs every weekday from 10pm - 6 am. IIt is difficult for me to create the early and late shift, because they change every week. In calendar week 48 group A has the early shift (6 am- 14 pm) and group B the late shift (2 pm- 10 pm). In calendar week 49 group B has the early shift and group A the late shift and so on.

I would be very grateful for helpful tips!

New Member

My Data looks like this (each row is a user):DataData


My Conditional Column looks like this:



This is ok but I need to adjust the weekly change from the early and late shift group.

Super User
Super User

Please see this post regarding How to Get Your Question Answered Quickly:


Hard to be specific without source data. But, if you created an hours table like this:


R06_Table = 
VAR __Hours = 
            GENERATESERIES(1 , 12 , 1),
            [Value] & ":00:00 "
VAR __Period = 
        { ("AM"),("PM") },
VAR __HoursAMPM = GENERATEALL(__Hours, __Period)
VAR __Final = 
            TIMEVALUE([Hour] & [AM/PM])
        CONVERT(TODAY() & " " & [Time], DATETIME)


You could create a Shift column like this:


Shift = 
VAR __1stBegin = 9
VAR __2ndBegin = 17
VAR __3rdBegin = 1
VAR __Time = TIMEVALUE('R06_Table'[Time])
VAR __Hour = HOUR(__Time)
    __Hour >= __1stBegin && __Hour < __2ndBegin,"First",
    __Hour >= __2ndBegin || __Hour < __3rdBegin,"Second",





@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors