Forum Discussion
Leave/holiday chart with horizontal bars
Hello all,
I'm trying to create a leave/holiday chart with horizontal bars that we can link up with a spreadsheet exported from our HR system.
Basically the spreadsheet contains columns for the employee name, holiday start date and holiday end date. There would be multiple rows for each employee to reflect all of the leave they have booked for the year.
Here is mock-up of what I would like Power Bi chart to look like:
Here is an extract of the Excel data:
| First Name | Last Name | Holiday Start Date | Holiday End Date |
| Employee 1 First Name | Employee 1 Last Name | 16/02/2022 | 18/02/2022 |
| Employee 1 First Name | Employee 1 Last Name | 24/06/2022 | 01/07/2022 |
| Employee 1 First Name | Employee 1 Last Name | 08/07/2022 | 18/07/2022 |
| Employee 2 First Name | Employee 2 Last Name | 19/04/2022 | 22/04/2022 |
| Employee 2 First Name | Employee 2 Last Name | 24/05/2022 | 24/05/2022 |
| Employee 2 First Name | Employee 2 Last Name | 26/05/2022 | 26/05/2022 |
| Employee 2 First Name | Employee 2 Last Name | 02/07/2022 | 16/07/2022 |
I'm new to Power Bi so learning as I go along
I was wondering if anyone had any ideas on if such a chart would be possible in Power Bi, and if it was how I would go about creating it?
Many thanks
5 Replies
- Syk
Resident Rockstar
It looks like you want some sort of Gantt chart. In the visuals pane, you can bring in more visuals. Select get more visuals and then search for "Gantt". This is probably a good starting point at least..
- CH_MJR79
Helper II
What I am looking for is exactly what is detailed on this post: (Link) although unfortunately the op didn't post any details as to how he created it.
I have taken a look at the Gantt chart options but with a Gantt chart each new entry is a task, and each task can only have one start and end date. In my case, each employee will have multiple start and end dates to reflect all of the holiday dates they have booked for the year.
- Syk
Resident Rockstar
That post is using a table with conditional formatting. Basically showing if the value is "AL", make the background green
- AnonymousNot applicable
Hi CH_MJR79 ,
Here are the steps you can follow:
1. In Power query. Add Column – Index Column – From 1.
2. Create calculated column.
Day = DATEDIFF('Table'[Holiday Start Date],'Table'[Holiday End Date],DAY)3. Find Gantt Chart by MAQ through Get more visual.
4. Find Category labels - open Hierarchy layout.
5. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- CH_MJR79
Helper II
Thanks, but it seems to be showing everything in terms of months rather than detailing each individual day of the month.
Also, each separate leave date for each employee is on a separate line.