Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Automater
New Member

Problem with "pivote column" function

Hello everybody,

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

Automater_0-1684938081079.png

to this: 

Automater_1-1684938111383.png

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):

Automater_2-1684938191878.png

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

Automater_4-1684938436915.png

 

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

Automater_3-1684938398147.png

 

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

 

Thanks!

Max

5 REPLIES 5
BA_Pete
Super User
Super User

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




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

Automater_0-1684942113966.png

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.

 

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



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Tried it too.

I added an index column before the first unpivot:

Automater_0-1684948795525.png

And after the unpivot step it looks like this:

Automater_1-1684948820789.png

But if I want to pivot it back again I still receive the same error... 

 

Do you have any other tips?

 

Thank you so much

Max

 

 

It looks like you've unpivoted the Index with the other columns.

Select your index column before the unpivot step, go to the Transform tab > Unpivot Columns (dropdown) > Unpivot Other Columns. This should keep your Index column intact to be used as an ID for the pivot step later.

 

If this doesn't work, can you provide your initial data from the following screenshot as copyable data please?

BA_Pete_0-1684993271148.png

 

You can copy it from Excel and paste it directly in here, or you can paste it into 'Enter Data' in Power Query and copy the M code from that query.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.