Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , This seems like unpivot twice case. See if this can help

 

https://kohera.be/power-bi/how-to-unpivot-twice/

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , This seems like unpivot twice case. See if this can help

 

https://kohera.be/power-bi/how-to-unpivot-twice/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.