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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.