Using power query to manage data files with "moving" columns

Joanne 56

New Member
Joined
Jan 23, 2016
Messages
14
I get a daily report which has data with some variability in terms of what column any given header may arrive in (i.e. column AAC today is column something else tomorrow). The report comes with six rows of header details so already requires a transpose/merge/transpose activity ... Is there a way within power query to manage this without changing the original report? Thanks for any suggestions ...
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Is the problem that (a) the same data can have different column header text each time , or (b) the data and column headers are the same but in different column placement and you need to get the columns to a specific order? If (b) and you know the column names, you can just rearrange them by name using =Table.ReorderColumns(#"previous step",{"Col1", "Col2", "Col3", "ColX"})
 
Upvote 0
I have the same problem though with fewer columns - they can appear in any order.

A workaround for me was unpivoting the columns so that the headers become values of a new column (using Other Columns so you don't have to enumerate the changeable ones). If you need all instances of rows and columns rather than just the ones with data then be sure to set any null values to zero before the unpivot. If you can perform your necessary calculations on the values at that point do so, then you can re-pivot the columns if needed.
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,943
Members
448,534
Latest member
benefuexx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top