KNOWLEDGE BASE

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

Published: 22 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

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.