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
yetanotherusern
New Member

Transpose? Pivot? Unpivot?

With PowerQuery how can I get from this

HeaderID
Comment from X1
Group 12
Posted Aug 8, 20223
ID123224
  
  
Comment from John1
Group 22
Posted Sep 6, 20223
ID1234
  
  
Comment from John1
Group 22
Posted Sep 12, 20223
ID123234

 To

1234
Comment from XGroup 1Posted Aug 8, 2022ID12322
Comment from JohnGroup 2Posted Sep 6, 2022ID123
Comment from JohnGroup 2Posted Sep 12, 2022ID12323

 

Thank you so much

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @yetanotherusern 

you can use the Pivot Operation, but first you have to prepare the table:

  1. remove the empty rows
  2. add an index column
  3. create a grouping column (a custom column), this one is necessary, otherwise Pivot will not work

This is how the table will look after these steps:

image.png

This is the formula for the custom column.

Number.RoundUp( [Index] / 4 )

Then i removed the Index column, marked the ID column and use the transform Pivot configured like this:

image.png


And here is the result:
image.png

Hopefully, this provides what you are looking for.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey @yetanotherusern 

you can use the Pivot Operation, but first you have to prepare the table:

  1. remove the empty rows
  2. add an index column
  3. create a grouping column (a custom column), this one is necessary, otherwise Pivot will not work

This is how the table will look after these steps:

image.png

This is the formula for the custom column.

Number.RoundUp( [Index] / 4 )

Then i removed the Index column, marked the ID column and use the transform Pivot configured like this:

image.png


And here is the result:
image.png

Hopefully, this provides what you are looking for.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Herzlichen Danke - wirklich toll! 

(Heartfelt thank you - really cool)

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.