Forum Discussion
jcastr02
1 year agoPost Prodigy
Rearrange columns
I am trying to rearrange my columns in power query to stack on top of each other. I have to stack all like columns together...see example below and desired outcome. How could I achieve this in PQ? ...
- 1 year ago
Three stores I see. I would use the same approach.
Any number of stores?
Is doable, but will take som complex coding.
Something along the lines of:- Demote the headers (if you didn't already)
- Make a list of all the sub tables by looking at the total number of columns and using Table.Columnnames() and List.Range to get the column names to select
- Table.Combine(the_list_you_just_created)
PwerQueryKees
1 year agoSuper User
Only 2 stores?
- Make a reference to you table
- In your original table Select the first store columns
- In your reference table select the second store columns
- In your reference table
Table.Combine({Table, #"Last Step in your reference table query"})
I did this from the top of my head ...
Did I answer your question? Then please mark my post as the solution and make it easier to find for others having a similar problem.
If I helped you, please click on the Thumbs Up to give Kudos.
Kees Stolker
A big fan of Power Query and Excel
- PwerQueryKees1 year agoSuper User
Three stores I see. I would use the same approach.
Any number of stores?
Is doable, but will take som complex coding.
Something along the lines of:- Demote the headers (if you didn't already)
- Make a list of all the sub tables by looking at the total number of columns and using Table.Columnnames() and List.Range to get the column names to select
- Table.Combine(the_list_you_just_created)