Forum Discussion
Anonymous
5 years agoNot applicable
Reformat a table in query
Hi,
I have a table like this:
| Feature1 | Feature2 | Key1 | Key2 | Val1 | Val2 |
| Test1-1 | Test2-1 | Key1-1 | Key2-1 | Val1-1 | Val2-1 |
| Test1-2 | Test2-2 | Key1-2 | Key2-2 | Val1-2 | Val2-2 |
| Test1-3 | Test2-3 | Key1-3 | Key2-3 | Val1-3 | Val2-3 |
I want to transform it to this format in the power query:
| Feature1 | Feature2 | Keys | Key Values | Vals | Val Values |
| Test1-1 | Test2-1 | Key1 | Key1-1 | Val1 | Val1-1 |
| Test1-2 | Test2-2 | Key1 | Key1-2 | Val1 | Val1-2 |
| Test1-3 | Test2-3 | Key1 | Key1-3 | Val1 | Val1-3 |
| Test1-1 | Test2-1 | Key2 | Key2-1 | Val2 | Val2-1 |
| Test1-2 | Test2-2 | Key2 | Key2-2 | Val2 | Val2-2 |
| Test1-3 | Test2-3 | Key2 | Key2-3 | Val2 | Val2-3 |
The focus here is mainly on key and value columns.
I have worked with unpivotting, but was not successful to get exactly this format.
The reason I want exactly this format is that I can easily show two columns of Key Values and Val Values in a table visual.
Looking forward to your help.
Anonymous , This seems like unpivot twice case. See if this can help
1 Reply
- amitchandakSuper User
Anonymous , This seems like unpivot twice case. See if this can help