How to Create a Tableau Dashboard to Track Work Hours?

Muhammad Azhar
4 min readAug 20, 2022

In this tutorial, I am going to show you how to create a dashboard to track how many hours did an employee work on a project. This could be used by the manager or supervisor of your employees to track their time.

This challenge is from Erica Hughes for week 30 of #WOW2022.

Requirements for the challenge

Solution:

From the requirements, I gather that I need to create a heatmap and a bar chart. Also, I need to make it possible for the user to select a range. All other requirements fall into these three major requirements.

First thing first, Connect to your data source. You can get the data here.

Parameters allow users to enter different types of information into your dashboard without creating a new field for each possible input.

  • I created three parameters — two date parameters (start date & end date) to select the date range and one Date Level parameter to allow the user to choose default, days, weeks, or months.
Parameters

Now that parameters are in place, let’s create the required calculated fields.

  • Create a calculated field to calculate the number of selected days.
  • As per requirements, the default view has three different view options — day, week, and month. The following calculation creates three different date levels.
Default Date Level | image by author
  • I created a calculation for determining date levels. It will allow for changing the date level by the user.
  • The default date level has three sub-levels, and each one of those requires its Date labels.
  • To format time as Hour + minutes.
  • A calculated field to filter for the selected date range.
  • Drag “Filter — Date Range” and “Project” to the filter pane. Add both filters to contexts. You can learn about Tableau’s order of operation here.
  • To add filters to context, right-click the filter and select “Add to context.”

Heatmap:

  • Drag “Selected Date Level” & “Label — Date Level” to columns. Also, drag “employee name” to rows. You’ll have something like this.

I also need to sort this chart by Total hours in descending order.

To do that, I created a new calculated field, “Sort — Desc.” It calculates the sum of hours worked for each row — each employee. Drag this field to rows before employees.

I stole this from Erica’s work.
  • Make sure it is computed using the Selected Date Level.

Bar Chart:

  • Drag Minutes to columns and Employee Name to rows. Also, add the time label to the label and sort it by total time in descending order.
  • Make sure that Tooltips and labels are properly formatted.

Dashboard:

  • Create a new dashboard (1200 x 800)
  • Add a Title
  • Add filters
  • Add charts
  • and voila

Click for Interactive Dashboard

I hope this tutorial helped you. If you need help with this or other questions about creating dashboards, feel free to reach out to me on Twitter!

--

--

Muhammad Azhar

BI Consultant | Tableau Ambassador. I write about data analysis, data visualization, and BI Reporting.