Pivot a column with TEXT content IN POWER QUERY

Fredy Herrera 20 Reputation points
2024-02-20T16:17:52.8+00:00

Hi, I need the values in my column Attribute1 to be converted into columns (three columns in this case) and filled with the values in the column 'values'. I need to do this in Power Query. I give an example of the result I need. I'm trying to do it using Pivot Table, choosing the Value column('Values') and the 'don't aggregate' option. but it shows me this error "Expression.Error: There were too many elements in the enumeration to complete the operation. Details: [List]" I appreciate the help. Original data: User's image

Ouptut: User's image

Microsoft 365 and Office Excel For business Windows
0 comments No comments
{count} votes

Accepted answer
  1. Jiajing Hua 18,060 Reputation points Moderator
    2024-02-21T03:56:35.5666667+00:00

    Hi @Fredy Herrera

    In my opinion you may add one extra column, and use uniqueness of this column to pivot.

    • So please group your table by "Attribute.1", the Operation is "All Rows". User's image
    • Add a custom column, and use this formula =Table.AddIndexColumn([All],"Index",1). User's image
    • Expand the query table, please don't tick "Attribute.1". enter image description here
    • Then remove the previous extra column, pivot the table as you did before. Choose the Value column and the "Don't aggregate" option. enter image description here
    • Remove the Index column, then you will get the one. enter image description here

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.