KNOWLEDGE BASE

Calculate percent complete when joining list of employees whom completed the task with list of all employees


Published: 22 Jun 2017
Last Modified Date: 23 Jun 2017

Question

How to calculate the percentage of employees who completed a task, out of all employees, when the data is structured as two joined tables: 1) a list of employees that completed the task, and 2) a list of all employees.

Environment

  • Tableau Desktop

Answer

The attached example workbook uses sample data to demonstrate the following instructions:
  1. Create a calculated field with a name like "% Complete" with a calculation similar to the following:

    COUNTD([Employee Name (Task Completion)])
    /
    SUM({ FIXED : COUNTD([Employee Name]) })
     

    The above calculation will count the distinct number of employees per partition in the view and divide that by the fixed number of unique employees in the entire data set.
  2. Right-click on [% Complete] in the data pane and select Default Properties > Number Format…

  3. In the Default Number Format dialog, select Percentage and click OK.

  4. Create a calculated field with a name like "% Incomplete" with a calculation similar to the following:
    1 - [% Complete]

  5. Repeat steps 2-3 for [% Incomplete]

  6. Drag [Task] to the Rows shelf.

  7. Drag [% Complete] to Text on the Marks card.

  8. Double-click [% Incomplete] in the data pane to add the field to the view.

  9. Drag [Measure Values] from the Columns shelf to the Rows shelf.

Additional Information

Instead of attempting to create a calculation that will categorize all employees as either "complete" or "incomplete" for every task, we need to create separate calculations for percent complete and percent incomplete. In order to assign an employee "incomplete" for more than one task, that employee must have a row in the underlying data source for each task.
Did this article resolve the issue?