+ Reply to Thread
Results 1 to 4 of 4

Unpivot with PowerQuery possible?

  1. #1
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Unpivot with PowerQuery possible?

    I'm not even sure if unpivot is the function that I would have to use to get my results. Here is how my powerquery table is laid out currently:
    ColumnA (Name) Column B (Tier)
    Dog Tier 1
    Cat Tier 1
    Pig Tier 1
    Cow Tier 2
    Bird Tier 2
    Fish Tier 3
    Bear Tier 3
    Deer Tier 3

    This is what I would want the result to be:

    Column A (Tier 1) Column B (Tier 2) Column C (Tier 3)
    Dog Cow Fish
    Cat Bird Bear
    Pig Deer

    Is this possible in PowerQuery?

    Edit: I attached a workbook since it's hard to do the spacing in the post.

    Thanks for the help.
    Attached Files Attached Files
    Last edited by nobodyukno; 08-23-2017 at 12:29 PM.

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Unpivot with PowerQuery possible?

    If you reorganize source table it will be possible.

    pq.jpg

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by sandy666; 08-23-2017 at 01:09 PM.

  3. #3
    Forum Contributor
    Join Date
    12-29-2012
    Location
    usa
    MS-Off Ver
    Excel 2016
    Posts
    325

    Re: Unpivot with PowerQuery possible?

    Quote Originally Posted by sandy666 View Post
    If you reorganize source table it will be possible.

    Attachment 534946

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    I organized my data in the way you laid out in Columns D:F. When I enter your code in PowerQuery I get a value error? In PowerQuery, I select the name column and click pivot. I just accept whatever it tells me to do. Then, I take the code you posted, and paste that into the formula bar and that is when I get the Value error.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Unpivot with PowerQuery possible?

    in PQ select Tier, then Pivot then Name

    TIP: if you want to show text values as text you can't count/sum/average etc. these values
    Last edited by sandy666; 08-23-2017 at 04:25 PM.

+ 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. VBA vs PowerQuery
    By Trachr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2017, 11:50 PM
  2. PowerQuery and VBA
    By Trachr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2017, 12:10 AM
  3. Help with powerquery.
    By stephme55 in forum Excel General
    Replies: 0
    Last Post: 09-01-2016, 07:31 PM
  4. Unpivot Macro
    By nigelbloomy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-02-2015, 05:25 PM
  5. Unpivot Data
    By naveeddil in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-07-2015, 08:04 AM
  6. how to unpivot
    By naveendk55 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2014, 09:55 AM
  7. Unpivot Data
    By Olly in forum Tips and Tutorials
    Replies: 0
    Last Post: 04-02-2014, 05:33 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