+ Reply to Thread
Results 1 to 4 of 4

Power query change column names

  1. #1
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Power query change column names

    Hi All.

    I have a power query querying a server. I am getting billing$ by year. I pivoted the year column. How can I "M Function" the column names from "2017" to "Bill$ 2017". There are a thousands of projects. Something that will do "for each column, concatenate "Bill $" to the front of current column name

    current:
    project 2017 2018 2019 2020
    abc $500 $600 $700 $800

    Future:
    project Bill$ 2017 Bill$ 2018 Bill$ 2019 Bill$ 2020
    abc $500 $600 $700 $800


    Thanks.
    Steve
    Harrisburg, PA

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Power query change column names

    Right click on the column and select rename
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Re: Power query change column names

    I want to do it programatically... the year values may be different for different runs. something that will do "for each column, concatenate "Bill $" to the front of current column name

  4. #4
    Forum Contributor
    Join Date
    10-02-2013
    Location
    Harrisburg, PA
    MS-Off Ver
    Office 365 MSO (16.0.10730.20264) 32-bit
    Posts
    160

    Re: Power query change column names

    I created a work around... I am doing a pivot column to make a cross tab. So, to fix this, I am just concatenating "Bill$" to the Year before I pivot the column.

    Solved.

    Thanks.

+ 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. Code to change Power Query source and refresh
    By kersplash in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-23-2021, 07:35 AM
  2. [SOLVED] Power Query Group by Each Change in Column Value
    By ibuhary in forum Excel General
    Replies: 9
    Last Post: 12-15-2019, 04:41 AM
  3. 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
  4. [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
  5. Replies: 2
    Last Post: 02-13-2019, 07:39 AM
  6. Power Query: Change All --> Type and Uppercase
    By learning new things in forum Excel General
    Replies: 10
    Last Post: 11-29-2018, 05:40 PM
  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