Forum Discussion
Help flattening data
I know somehow this data needs a pivot, but I just need some guidance as I do not have much experience with pivoting data. This is a sample of data coming into a table in our Power BI report. It has been filtered by an employee, year, and month. What I need is a table that has only the DATE as a record and then columns for Task Number and Instance Entered.
So for example, in this data listed, there would be ONE record for each data: 4/3/2023, Task 1, 1; 4/4/2023 Task 1, 1, Task 2, 3...
| EmpID | DateRecorded | TaskNumber | InstancesSubmitted |
| 264 | 4/3/2023 | Task 1 | 1 |
| 264 | 4/4/2023 | Task 1 | 1 |
| 264 | 4/4/2023 | Task 2 | 3 |
| 264 | 4/6/2023 | Task 1 | 1 |
| 264 | 4/10/2023 | Task 1 | 1 |
| 264 | 4/11/2023 | Task 1 | 1 |
| 264 | 4/12/2023 | Task 1 | 1 |
| 264 | 4/13/2023 | Task 1 | 1 |
| 264 | 4/17/2023 | Task 2 | 7 |
| 264 | 4/18/2023 | Task 2 | 1 |
| 264 | 4/18/2023 | Task 2 | 6 |
| 264 | 4/19/2023 | Task 1 | 1 |
| 264 | 4/19/2023 | Task 2 | 4 |
| 264 | 4/20/2023 | Task 1 | 1 |
| 264 | 4/20/2023 | Task 2 | 2 |
| 264 | 4/24/2023 | Task 1 | 1 |
| 264 | 4/24/2023 | Task 2 | 2 |
| 264 | 4/25/2023 | Task 1 | 1 |
| 264 | 4/25/2023 | Task 2 | 3 |
| 264 | 4/26/2023 | Task 1 | 1 |
| 264 | 4/26/2023 | Task 2 | 5 |
| 264 | 4/27/2023 | Task 2 | 1 |
Thanks for the help. I really appreciate it.
2 Replies
- PoweredOutResolver I
You can use the Matrix visual. Put the date in the columns and the task in the rows, then insidents in values
- CMSGuyHelper III
Yes tried that, but there are two other tables that need to relate to this table. There is a main Employee Table where the EmpID comes from. Then a Details table (the one I need to flatten) that is related by the EmpID. Then I have an Hours Worked table (related by that EmpID and date) and a Ratings table (related by the same Emp ID and date). When I include hours or ratings, there are way too many columns (hours and ratings for each Task).