Forum Discussion
Jaime123
8 years agoRegular Visitor
Sum values from different columns based on row data
Hi all,
I am trying to create a new table where I can summarize all activities by "owner", the problem I am having is that activities are listed in different columns in the original table. Here is an example of the original table:
| Name | Emails | Surveys | Videos |
| John | 2 | 4 | 0 |
| Mary | 1 | 3 | 1 |
| Paul | 0 | 4 | 3 |
| Mark | 3 | 1 | 1 |
| John | 3 | 1 | 1 |
| Mary | 3 | 0 | 0 |
| Paul | 1 | 3 | 2 |
| Mark | 0 | 0 | 1 |
And here is the table I am trying to create:
| Name | Activity | Count |
| John | Emails | 5 |
| Mary | Emails | 4 |
| Paul | Emails | 1 |
| Mark | Emails | 3 |
| John | Surveys | 5 |
| Mary | Surveys | 3 |
| Paul | Surveys | 7 |
| Mark | Surveys | 1 |
| John | Videos | 1 |
| Mary | Videos | 1 |
| Paul | Videos | 5 |
| Mark | Videos | 2 |
I will appreciate any help to create the new table, or any ideas on how to create the new table.
Regards.
J
Seems a straightforward unpivot of everything but the name, then group by the name/old column headers task in Power Query
1 Reply
- jthomsonSolution Sage
Seems a straightforward unpivot of everything but the name, then group by the name/old column headers task in Power Query