Forum Discussion
Expression.Error: There weren't enough elements in the enumeration to complete the operation
- 10 years ago
This error is thrown when pivoting columns with same name. Please check your column names in your data source. Also refer to a similar thread below:
Regards,
This error is thrown when pivoting columns with same name. Please check your column names in your data source. Also refer to a similar thread below:
Regards,
- CR3039 years agoRegular Visitor
This soultion was helpful in that it gave met ideas on how to find ther error, but I found the error in my query was not related to pivoting but referring to a row at an index that did not exist. I'm including an explanation here in case it helps others:
I was adding a column that would store a list of values for the current record, but I had initially created an index that started at 1 instread of 0. Therefore, the last record in my query table would have an error value. Since this was outside of the preview range, the error was not apparent until I tried to load to the data model. Lesson learned: the first record in a table should be referred to with a zero, i.e. TableName{0}
#"Record Vlaues" = Table.AddColumn(#"Added Index", "NewColumn", each Record.FieldValues(#"Added Index"{[Index]})) - Seaweed819 years agoRegular Visitor
I know this is an old post, however, I'm having the same issue, the strange thing about mine is if I hit refresh several times it will eventually work generally. Sometimes it will even work on the 1st try. I'm not very good with this stuff as it was mostly built for me so I'm trying to learn more about it but this error is beyond frustrating.
- Seaweed819 years agoRegular Visitor
I know this is an old post. However I'm having the same issue right now. The strange thing is if I refresh several times then it eventually works. Sometimes it works on the 1st try. This is while not changing anything. I'm rather new to this as most of this was built for me, but I'm trying to learn it and I just simply can't figure this out. I've check all the columns and such, but nothing is jumping out at me.
- kymramosrpo3 years ago
Advocate V
To add to this, here's a video tutorial by ruthpozuelo that I was very grateful to have found:
How to fix the "Too many elements in the enumeration to complete..." pivot error in Power Query
Curbal, Mar 16, 2020
- jnnvac2 years agoNew Member
This error is also caused when merging data from another table that has duplicates.