Question
Extract the start and end date of a sick leave in power query (gaps and islands)
I would like to have a max and min date of the different types of absence for every employee for project. I would like to have it in Power BI but I don't know how to do it.
There are 3 columns that this should be grouped: Project ID, Person ID and Time Status.
I thought about grouping also on Month and Year but then if there will be situation that there is 2 sick leaves in the same month it will not work properly. Here is an example of data:
And the outcome should be like that:
Thanks.
Here is the sample of the data:
Project ID Person ID Time Status Date
10 1 Sick leave 21.06.2024
10 1 Sick leave 09.07.2024
10 1 Sick leave 10.07.2024
10 1 Sick leave 11.07.2024
10 1 Sick leave 12.07.2024
9 2 Annual leave 12.08.2024
9 2 Annual leave 13.08.2024
9 2 Annual leave 14.08.2024
9 2 Annual leave 15.08.2024
9 2 Annual leave 31.08.2024