Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I need to make the start date and end date columns from the date column, in a new tabel. I have a table of employees and the dates on which they are absent because of sickness but I need to reduce the table so that there is no separate row for each date if that date is part of a absent period that lasts more than one day. furthermore i need it to also make a column where is sums up the hours they were absent in that period.
Example Input:
Name Date Type of absence Hours Ivana 15/06/2023 Sick 8 Ivana 16/06/2023 Sick 8 Ivana 17/06/2023 Sick 4 Ivana 18/06/2023 Sick 8 Ivana 19/06/2023 Sick 8
Ivana 20/06/2023 Sick 8 Ivana 05/01/2023 Sick - Doctor 2 Ivana 20/05/2023 Sick 8 Ivana 21/05/2023 Sick 5
Expected Output:
Name Start Date EndDate Hours Ivana 15/06/2023 20/06/2023 36 Ivana 05/01/2023 05/01/2023 2 Ivana 20/05/2023 21/05/2023 13
Solved! Go to Solution.
pls see the attahment below
Proud to be a Super User!
why the first row is not 44?
pls see the attachment below
Proud to be a Super User!
Hello, i tried your approach however it splits up the period because of the weekend, how can i fix this?
To be more specifik, i want the weekend included in the period. Lets say:
Name Date Type of absence Hours Ivana 15/06/2023 Sick 8 Ivana 16/06/2023 Sick 8 Ivana 19/06/2023 Sick 8
Ivana 20/06/2023 Sick 8
I want to see this
Name Start Date EndDate Hours Ivana 15/06/2023 20/06/2023 32
pls see the attahment below
Proud to be a Super User!
Thank you so much, it seem to work for weekend however how can i also make it consider public holidays in the dax code. I have a date table where i distiguise between weekdays, weekends and holidays
then you can combine calendar table and holiday table ,then to update the result
Proud to be a Super User!
Hello @ryan_mayu , i have made a sample file, would you be able to help in how i can considere the holidays in the dax formula
https://drive.google.com/file/d/1255SoUAgTZfRbtww6K3h2uSe3QRPBm65/view?usp=drive_link
I can't open the google drive, i updated your sample file, pls see the attachment below
Proud to be a Super User!
i have a seperate data table currently where i have the holidays
User | Count |
---|---|
77 | |
76 | |
44 | |
30 | |
26 |
User | Count |
---|---|
97 | |
91 | |
52 | |
47 | |
46 |