Create a Calendar in Tableau

Calendars are a great and creative way to show performance metrics in Tableau. The example below shows total time spent by a sales person in the month of May. In this case, time spent in hours is our performance metric. 

Example Image of Final Viz

How To Guide

Prepare Data Source

For creating this example, I used an Excel file as my data source. There were two tabs total:

Employee Name (Tab 1) Fields - Name ID (Primary Key), First Name, Last Name

Time Spent (Tab 2) Fields - Time ID (Primary Key), Date, Name ID (Foriegn Key), and Time (in hours)

Not all of these fields are necessary. However, the mimic setups commonly seen in relational databases. Also, it is extremely helpful to have all dates (in the needed range) within the data set. In the example picture above, the May 2nd is present, which was a Saturday, even though 0 time was spent. 

Connect to Data

Connect to your spreadsheets, joining on the primary/foreign key (in this example, Name ID):

Creating a Calendar

Add your date as a discrete weekday to columns (red arrow), discrete week to rows (green arrow), and filter by discrete month for month you want to display (blue arrow). Alternatively, you can add a single value quick filter for months to cycle through.

Change mark type to square. Right click to hide column label Date and right click to un-select  Show Header for rows (Week of Date).

Add discrete day to label (red arrow) and align to the center of the squares (green arrows).

Add a single value quick filter for sales person. Remove ALL option:

Create performance metric for color by creating a calculated field. In this example, we return "RED" wherever <= 2 hours, "YELLOW" for <= 4, and "GREEN" otherwise (> 4 Hours).

Add newly created calculated field to color on marks shelf. Edit colors so they match they descriptions.

Optional Steps: Add Hours to Labels on Marks Shelf to display the number of hours per sales person. Also, optionally create a calculated field to concatenate First Name with Last Name for filter.


The End Visualization

Click the blue link to interact with this Viz on Tableau Public.

Author: Alex Christensen