+ Reply to Thread
Results 1 to 16 of 16

Power Query - Add another column to Table.TransformColumns

  1. #1
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Power Query - Add another column to Table.TransformColumns

    Hello, I have a Power Query code to group the data. However, this is for two columns. Can anyone help me with the code to get another column?


    Please Login or Register  to view this content.
    Expected Output.JPG
    Attached Files Attached Files
    Last edited by signup1; 08-26-2021 at 06:54 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,455

    Re: Power Query - Add another column to Table.TransformColumns

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Actually, I tried to attach the workbook but couldn't. Will add it again as mentioned. Thanks!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,455

    Re: Power Query - Add another column to Table.TransformColumns

    You've attached a picture. I can't do anything with an image - please provide the WORKBOOK.

  5. #5
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Yeah, I have uploaded the workbook now. Thanks

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,455

    Re: Power Query - Add another column to Table.TransformColumns

    The attachment does not contain the query you have already. Try again, please.

  7. #7
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Sorry, Do you want me to apply the code in the workbook as power query?

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,455

    Re: Power Query - Add another column to Table.TransformColumns

    You said you had code that worked on two columns - I presumed you had applied it to your data. I want the workbook where you have applied the code so that I can help you to tweak it.

  9. #9
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    I have applied the code and the query output is in the first sheet. The expected output is on 3rd sheet.

    Thanks!
    Attached Files Attached Files

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,455

    Re: Power Query - Add another column to Table.TransformColumns

    I've run out of time now - sorry. Someone else will no doubt step in.

  11. #11
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Ohhh! Plz, help when you have time.
    Thanks for the prompt responses.

  12. #12
    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 - Add another column to Table.TransformColumns

    This is a Power Pivot Solution. Create two measures using Concatenatex. Attached is your file with the solution. Also, to help you understand better, look at this link

    https://sfmagazine.com/post-entry/ju...a-pivot-table/
    Attached Files Attached Files
    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

  13. #13
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Thanks for your response. I have tried to get it but I got it as below. Can you suggest what needs to be done to get the final output as you provided?

    Column name instead of Row labels? Removing Grand total row?
    Attached Images Attached Images

  14. #14
    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 - Add another column to Table.TransformColumns

    I used the Raw Data on the "Required Output" Tab and the name of the field "Character Name" is what I used in the PP. Look at the Pivot Table I created. Not sure what you used for source data. Removing Grand Totals is a check box on the Ribbon under Design

  15. #15
    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 - Add another column to Table.TransformColumns

    crossposted: https://www.mrexcel.com/board/thread...0/page-4#posts

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Read this to understand why we ask you to do this.

    I have added the crosspost reference for you today. Please comply with this and all our rules in the future

  16. #16
    Registered User
    Join Date
    08-26-2021
    Location
    India
    MS-Off Ver
    Office 2019
    Posts
    8

    Re: Power Query - Add another column to Table.TransformColumns

    Sorry!! I have replied there. I will avoid cross-posting further. 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. [SOLVED] Create a Table or 4 column based upon dataset - Power Query or Macro???? Help
    By cvici in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2021, 02:24 AM
  2. Replies: 1
    Last Post: 05-07-2021, 05:40 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. [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
  6. Replies: 2
    Last Post: 02-13-2019, 07:39 AM
  7. Power Query - add column with Table name
    By zico8 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 05-11-2017, 12:58 AM

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