Forum Discussion
Assigning Rotating Shift Teams based on Date
- 1 year ago
'Table' is just there as a means of entering the data. You could instead manually enter 'Base Table' which has the shift and offset info, and then Dates With Shifts would generate itself from that.
You can also hide all these tables in report view so that they're not cluttering everything up.
Create a calculated column in DAX that uses the date to determine the team for each shift. The rotation follows a 12-day cycle, with each team staying in a shift for 3 days. Use MOD(DATEDIFF(...), 12) to find the cycle position, then assign teams using SWITCH(TRUE(), ...) for each shift.
Shahid12523 thank you for your quick response on this matter, i am new on PowerBI and my Dax is very basic. would you mind to write me a dax script. I attach the powerbi file link below if that will make it easier for you. We can start on 1 apr 2025 with Team A (MorningShift), Team B (AfternoonShift), Team C (NightShift) and Team D (OFF)