+ Reply to Thread
Results 1 to 4 of 4

Power Query - Importing table and adding row below into a new column

  1. #1
    Forum Contributor
    Join Date
    06-30-2014
    Location
    London, England
    MS-Off Ver
    365 & 2010
    Posts
    107

    Power Query - Importing table and adding row below into a new column

    Hi,

    Really new to this power query malarkey and I am being told it is the way to go when cleaning data.

    I'm not sure if this can be done but I suppose there is no harm in asking.

    I sometimes get data where the value of cell b1 will appear in a2

    So it should be.

    img1.jpg

    But when importing the spreadsheet it appears as

    img2.jpg

    Is there a way of programming Power Query to putting the value from A2 into a new column aligned against cell A1 or at least combining them so A1 and A2 are in the same cell. I am sure there will be some conditional formatting involved.

    I also have hundreds of rows that I need this to be applied to so the sample file is only a snippet of what I need it to do.

    I attach a sample file with the required result A as a combined cell or B as 2 separate columns?

    Can it be done?PowerQuery_Can this be done.xlsx

  2. #2
    Registered User
    Join Date
    10-05-2024
    Location
    England
    MS-Off Ver
    2021
    Posts
    95

    Re: Power Query - Importing table and adding row below into a new column

    Hello! I think this is what you want.
    Stages of work:
    1. upload to Power Query
    2. removing rows with empty values
    3. adding an indexed column
    4. adding a custom column with the formula Number.IntegerDivide([Index], 2). Here "2" is the number of lines that need to be numbered equally.
    5. Here we group by a custom column, and using the Text.Combine function we combine cells by the column “Column1”, and also specify the separator “-”.
    6. delete the custom column.
    The result can be seen on the Table1 sheet in the attached file.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    06-30-2014
    Location
    London, England
    MS-Off Ver
    365 & 2010
    Posts
    107

    Re: Power Query - Importing table and adding row below into a new column

    Perfect. Thank you

  4. #4
    Registered User
    Join Date
    10-05-2024
    Location
    England
    MS-Off Ver
    2021
    Posts
    95

    Re: Power Query - Importing table and adding row below into a new column

    Happy to help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 04-20-2024, 12:52 AM
  2. Macro for Power Query? (adding column)
    By elbrujo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2019, 05:11 PM
  3. Adding Column in Power Query
    By fuerte in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-28-2018, 12:39 PM
  4. Adding Column in Power Query
    By fuerte in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2018, 11:15 AM
  5. Error problem, Importing table from pass protected workbook Power Query or other?
    By tta.akmal in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-29-2018, 03:59 AM
  6. Adding data to the end of a table with Power Query
    By afila in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-14-2016, 08:29 AM
  7. Importing CSV Files without adding a new query table
    By NatalieEC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-14-2015, 03:38 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1