Power Query Course in Spanish
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

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

  1. #1
    New Member
    Join Date
    Jan 2016
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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


    Using power query to manage data files with "moving" columns
    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 ...

  2. #2
    New Member
    Join Date
    Nov 2017
    Posts
    42
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Using power query to manage data files with "moving" columns

    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"})

  3. #3
    New Member
    Join Date
    Jan 2016
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Using power query to manage data files with "moving" columns

    Thanks. The problem is (b) - different column placement. There are around 1100 columns of data.

  4. #4
    Board Regular
    Join Date
    Apr 2014
    Location
    Mitten State
    Posts
    159
    Post Thanks / Like
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Using power query to manage data files with "moving" columns

    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.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •