Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Reformat a table in query

Hi,

 

I have a table like this:

 

Feature1Feature2Key1Key2Val1Val2
Test1-1Test2-1Key1-1Key2-1Val1-1Val2-1
Test1-2Test2-2Key1-2Key2-2Val1-2Val2-2
Test1-3Test2-3Key1-3Key2-3Val1-3Val2-3

 

 

I want to transform it to this format in the power query:

 

Feature1Feature2KeysKey ValuesValsVal Values
Test1-1Test2-1Key1Key1-1Val1Val1-1
Test1-2Test2-2Key1Key1-2Val1Val1-2
Test1-3Test2-3Key1Key1-3Val1Val1-3
Test1-1Test2-1Key2Key2-1Val2Val2-1
Test1-2Test2-2Key2Key2-2Val2Val2-2
Test1-3Test2-3Key2Key2-3Val2Val2-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.