Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
shane7mcdonald
Frequent Visitor

Custom roster calendar

Hi all, I have a problem I'm trying to solve. I need to create a custom roster calendar based on the following schedule;

 

- 8 day shifts

- 6 days off (RR)

- 7 night shifts

- 7 days off (RR)

 

Then the roster is repeated.

 

I have 4 crews who are all on a different parts of the cycle.

 

Below is what the calendar should look like over a few weeks.

 

DateShift AShift BShift CShift D
19/03/2020DNDRR
20/03/2020DNRRRR
21/03/2020DNRRRR
22/03/2020DNRRRR
23/03/2020DNRRRR
24/03/2020DNRRRR
25/03/2020DNRRRR
26/03/2020DRRND
27/03/2020RRRRND
28/03/2020RRRRND
29/03/2020RRRRND
30/03/2020RRRRND
31/03/2020RRRRND
1/04/2020RRRRND
2/04/2020NDRRD
3/04/2020NDRRRR
4/04/2020NDRRRR
5/04/2020NDRRRR
6/04/2020NDRRRR
7/04/2020NDRRRR
8/04/2020NDRRRR
9/04/2020RRDDN
10/04/2020RRRRDN
11/04/2020RRRRDN
12/04/2020RRRRDN
13/04/2020RRRRDN
14/04/2020RRRRDN
15/04/2020RRRRDN

 

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION
lbeneyze
Advocate II
Advocate II

Good morning,

 

I suggest you the following approach:

   1 you create a date column for the period you want

   2 you add a index column to the date table. In your example 3/19/2020 will be 1... 3/18/2021 will have 365

   3 add a custom column to create an increment of 28: if [Index] < 28 then [Index] else if [Index] - (28 * (Number.IntegerDivide([Index], 28))) = 0 then 28 else [Index] - (28 * (Number.IntegerDivide([Index], 28)))

   4 create different shift sequences with 2 columns: colum 1 is index from 1 to 28, 2nd column description of the shift: "D", "RR", N"

   5 Realise a full join on Date and Shift table based on Index column.

 

Did it answer your question? Please mark my post as solution

Did you like the answer? Please add a kudo.

 

Good luck and keep up the good job.

 

Kind regards,

Lohic Beneyzet

View solution in original post

2 REPLIES 2
lbeneyze
Advocate II
Advocate II

Good morning,

 

I suggest you the following approach:

   1 you create a date column for the period you want

   2 you add a index column to the date table. In your example 3/19/2020 will be 1... 3/18/2021 will have 365

   3 add a custom column to create an increment of 28: if [Index] < 28 then [Index] else if [Index] - (28 * (Number.IntegerDivide([Index], 28))) = 0 then 28 else [Index] - (28 * (Number.IntegerDivide([Index], 28)))

   4 create different shift sequences with 2 columns: colum 1 is index from 1 to 28, 2nd column description of the shift: "D", "RR", N"

   5 Realise a full join on Date and Shift table based on Index column.

 

Did it answer your question? Please mark my post as solution

Did you like the answer? Please add a kudo.

 

Good luck and keep up the good job.

 

Kind regards,

Lohic Beneyzet

Thanks @lbeneyze , that was most helpful! 👍

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.