Hey Guys,
Here is the problem statement,
I have a Schedules table, Here is the one with Sample data
What I am interested in any row that has “Shift” under the Segment Column.
the Date i need is from DateOfSchedule
Based on StartTime and Stoptime , I need to count, how many employees were available during a given 30 minute time interval like below.
In this Example, I have included the data for 14th January 2023.
So on 14th January, Employee ID - 1, he needs to be counted available for every interval begining 00:00 until 05:00 , as his start time was previous day.
but for example EmployeeID - 3 , in this case, he is counted available for every 30 minute intervals between Start Time 5:00 am and Stop Time is 2:45 pm. this is because both Start Time and End Time fall on same day.
Eventually the results need to go in a tabular format like this :
I have made several failed attempts to achieve this using power Query.
So sharing a clean pbx file with sample data.
schedule.pbix (109.4 KB)
Id really apprecieate any help finding the solution to this.
Either in Dax or in PowerQuery, I am curious to know whats the best approach for this
Thanks in advance.