+ Reply to Thread
Results 1 to 4 of 4

Power query: Copy values from one column to several others

  1. #1
    Registered User
    Join Date
    03-21-2019
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Win10
    Posts
    7

    Power query: Copy values from one column to several others

    I have 2 columns - A and B. I would like values in column B to be replaced by values in column A. Can this be done?

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Power query: Copy values from one column to several others

    Hi,

    Why can't you just duplicate column A and then delete column B?

    If that's not what you want, suggest you include more information.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    03-21-2019
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Win10
    Posts
    7

    Re: Power query: Copy values from one column to several others

    I want the heading for column B to remain the same.

    I have about 20 columns and I want their values to follow column A. Once the values are copied over, I will unpivot these 20 columns, hence the need to maintain the column headings.
    Edit: I have figured out the solution I'll just unpivot the 20 columns; a new column "Value" will be auto-created in this process. I just need to delete this and use column A as the new "Value" column.

    Still curious though, if there's a way to copy values across columns whilst maintaining heading names. Assuming I don't need to unpivot anymore...
    Last edited by meileetan; 11-24-2021 at 02:04 AM.

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Power query: Copy values from one column to several others

    You can do it with:

    = Table.ReplaceValue(#"Previous Step", each [Column2], each [Column1], Replacer.ReplaceValue, {"Column2"})

    though I doubt this is very efficient.

    Obviously amend the previous step name as well as the column references as required.

    Regards

+ 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: 08-10-2021, 02:08 AM
  2. [SOLVED] Power Query extract values from list column with nulls
    By Imbizile in forum Excel General
    Replies: 4
    Last Post: 02-04-2021, 10:00 AM
  3. [SOLVED] Power Query/Power Pivot Conditional Column creation & chart
    By mz_h in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-12-2020, 06:07 PM
  4. Replies: 10
    Last Post: 06-25-2020, 12:19 AM
  5. Custom Permutations Column in Power Query from two columns in the same Query
    By PaintPaddy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2019, 02:48 PM
  6. [SOLVED] Power Pivot does not load new column added in Power query
    By ibuhary in forum Excel General
    Replies: 12
    Last Post: 02-19-2019, 03:53 AM
  7. Sub-Forum for Excel Power Tools (Power Query, Power Pivot & Power BI)
    By chullan88 in forum Suggestions for Improvement
    Replies: 10
    Last Post: 06-28-2018, 02:25 PM

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