Did you know Power Query can be used as a task tracking tool? This might sound quite unusual but the method described here has been used for solving a real business case. The example I will use is rather simplified but still close to reality, and will demonstrate how to build task tracking with Power Query.
Laying out the Scenario
Vicky is a manager of a small team that is dealing with customer questions on various topics. One of her duties is to distribute various questions among her subordinates. After that, each of them should take some actions and report what is the status of each task.
The problem is – how can each employee can see what tasks are assigned to him/her and fill in the respective information for each task? At the same time, Vicky should at any moment be able to assign a new task and review the statuses of old ones. This is the table Vicky needs:
Unfortunately, she has no other tool at hand except Excel. Luckily, she can set up task tracking with Power Query right in Excel, which could work perfectly in this case.
Setting up Task Tracking with Power Query
So let's start building the solution.
1. Load the left table (in this example, called Filled by Manager) into Power Query.
2. Next, create one query for each employee by filtering the Employee column.
3. Load each Employee table into a separate Excel sheet. (Of course they can be on different files linked to the source table).
4. Then, create a table for each employee to fill in the actions and statuses.
You can see in the above picture what each employee will have in his/her worksheet - a green table on the left with the tasks assigned to them, and a yellow table on the right where he/she has to fill in the respective information.
Creating the Filled By Employees Table
5. Load all the Employee tables into Power Query.
6. Append them in a new query (in this example, called Statuses).
You are probably guessing what the next step is – load the Statuses query into Excel right next to the Filled By Manager table
However, the result is not what we would expect.
Note that on first row of the Manager’s table is a task assigned to Ivan on 27.01.2019, but row 1 of the Employee’s table shows the task assigned to Maria on 09.02.2019.
In order to fix this mess, we need one additional query.
Building the Task Code Query
7. Once again, load the Manager’s table into Power Query and remove all columns except for Task Code.
Task Code is a unique identifier of each task. In this example, it is simply composed of the employee's name and the number of occurrences of this name in the register up to the respective row. In Excel language, the formula is:
The trick is that we fix the first row of column F (containing the employees' names) but the end row is not fixed.
8. Merge the Register Employees and Statuses queries together.
9. Finally, expand the table and voila - it is in the required order. The only thing left is to load it back into the Manager’s table.
Now, any time she needs to, Vicky can refresh the Filled by Employees table and see the updated statuses of each task.
Likewise, each one of her subordinates can simply refresh the Manager’s table (the green one that is on left of his/her tab) to see any new tasks that have been assigned.
You could also automate the refresh operation VBA. For more details, refer to Chapter 16 of Ken's M is for (Data) Monkey book.
Final Words
This article presents nothing new and unusual as a Power Query technique. What is new and unusual is the way Power Query has been used for solving a typical business problem. This is just additional proof of how powerful and useful this tool is.
You can find the file with example here: Task tracking with PQ
One thought on “Task Tracking with Power Query”
Nice. But... The next step is making this file accessible and editable by the manager and team members. Even better, add security so team members can see and edit only their tasks. How to accomplish that:
Put the Excel file on the network and make it shared?
Put the Excel file on SharePoint?