+ Reply to Thread
Results 1 to 7 of 7

Power Query , Use distinct list of values as Row Headers

  1. #1
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    620

    Power Query , Use distinct list of values as Row Headers

    Hi,
    I've attahed a workbook showing in excel what I'd like to acheive in power query,

    I have done this in power query but it is not usable as I had to use Table.Disctinct, and in most cases this would not be the case,

    In excel I have a column and each cell contains, eg;
    a,b a,b,c d,a e,f

    and I would like to have a new column with a row for each distinct item.

    in excel ;
    Please Login or Register  to view this content.
    and for the values
    Please Login or Register  to view this content.
    But this part is secondary and I'd just like to get a column added.

    Richard
    Attached Files Attached Files

  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
    81,091

    Re: Power Query , Use distinct list of values as Row Headers

    When you split a column by delimiter, go to Advanced and choose rows. Then duplicate the letters column and pivot.

    Please Login or Register  to view this content.
    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
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    620

    Re: Power Query , Use distinct list of values as Row Headers

    Thanks, that's really good, I had a go with pivoting but had not thought of using the 'rows' .
    RD

  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
    81,091

    Re: Power Query , Use distinct list of values as Row Headers

    I saw what you'd done and realised that you had overlooked the advanced settings in the split column feature.

    Thanks for the rep.

  5. #5
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    620

    Re: Power Query , Use distinct list of values as Row Headers

    I used List Accumulate to get the final X , null ;

    First took TableColumnNames of Pivot table Names =
    Please Login or Register  to view this content.

    and then ;

    Please Login or Register  to view this content.
    RD

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,239

    Re: Power Query , Use distinct list of values as Row Headers

    You can assign the X/null when you pivot:

    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  7. #7
    Forum Contributor
    Join Date
    08-03-2021
    Location
    London
    MS-Off Ver
    365
    Posts
    620

    Re: Power Query , Use distinct list of values as Row Headers

    Thanks, wonderful idea, will be keeping that for future reference.

    RD

+ 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: 2
    Last Post: 05-12-2023, 07:35 AM
  2. Replies: 4
    Last Post: 04-20-2023, 04:02 AM
  3. Power Query Dynamic Headers?
    By NewYears1978 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 04-14-2023, 08:58 PM
  4. Power Query with Dynamic Headers
    By andrewc in forum Excel General
    Replies: 5
    Last Post: 11-17-2022, 03:14 PM
  5. [SOLVED] Power Query to identify distinct customers
    By josephteh in forum Excel General
    Replies: 1
    Last Post: 10-29-2020, 04:03 AM
  6. Power Query: Changing Headers
    By andrewc in forum Excel General
    Replies: 0
    Last Post: 09-23-2020, 02:07 PM
  7. [SOLVED] Power Query and imported table headers
    By Tresfjording in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2019, 06: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