Forum Discussion

Automater's avatar
Automater
New Member
3 years ago

Problem with "pivote column" function

Hello everybody,

I have following problem:
I depivote a table in power query going from this: 

to this: 

because I need to "translate" the values in the Column "Wert" with a second table. I translate those values and I end up with a table looking like this (only two columns):

The only thing, as I thought, would be pivoting the table again, using the column "Benutzerdefiniert" as the value column. As the aggregation method I chose "do not aggregate" as I want all values back in a table form, looking like the first screenshot just with translated values in the columns. 

But everytime it gives me the error:

Expression.Error: There weren't enough elements in the enumeration to complete the operation

 

And from my understanding with the MS documentation this should be possible:

 

I hope I described my problem well enough, and I'm open for all your tips.

 

Thanks!

Max

5 Replies

  • Hi Max,

     

    Try going to the Add Column tab > Index Column (dropdown) > From 1 BEFORE your last pivot step.

    This should give Power Query an ID to use in order to reallocate values correctly to columns.

     

    Pete

    • Automater's avatar
      Automater
      New Member

      Hi Pete,
      thanks for your answer. I tried it and the output looked like this:

      The problem here is, that for example the values of line 1,2,3 and 4 should be in one line, here they're splitted.

      • BA_Pete's avatar
        BA_Pete
        Super User

         

        Ok. Try dragging and dropping the Add Index step up your steps list to before your first Unpivot.

        This should give you ID groups after the unpivot that PQ will group back up correctly after the final pivot.

         

        Pete