In our second project, the client required to create a dashboard that provides insight into the annual leave of the company’s employees. I thought it would be a good idea to create a calendar to show the number of employees who took leave.  Then, the question is, how can I make a calendar in Tableau? Whenever I encounter technical problems, I feel fortunate to be part of Data School. Our wonderful coaches are available to share their skills and experience, and they often solve issues in just 5 minutes that would take me hours to figure out through Google searches. I highly recommend that if you are not already a member of Data School, you should apply and join our community. With the support of our coaches, you’ll be able to overcome technical challenges quickly and efficiently.

 

To create a calendar view in Tableau that displays the number of employees who took leave and allows for filtering between month and week views:

1. Drag the [date] field to the “Details” shelf and choose “Square” as the shape. This will display the dates as squares in a grid format.

Figure1: [date] onto ‘Detail’

2. If you want to display text on top of the squares, drag the [date] field to the “Text” card.

Figure2: [date] onto ‘Label’

3.Create a calculated field for the quarter number to group the months by quarter.

Figure3: Quarter

Figure4: Quarter calculation

4.Create a new sheet to make a weekly calendar. On the Rows shelf, choose “WEEK[date]” and on the Columns shelf, choose “Weekday[date]”.

Figure5: Week calendar

5.Connect the two sheets by creating a filter. Right-click on the month calendar and select “Filter” > “Add to Context.” This will create a filter context that will be shared between the two sheets.

6.Click on the month view to select the desired month, and the week view will automatically display only the weeks in that month.

7.Drag a measure, such as the number of employees taking leave, to the “Color” card on the Marks shelf in the week view.

Figure6: Employee number

8.Customize the week view as needed, such as by adding reference lines, labels, and tooltips.

The Data School
Author: The Data School