Forum Discussion
adinezza
Apr 01, 2022Copper Contributor
Error "There weren't enough elements in the enumeration to complete the operation." when Pivoting
I have a .txt file that I am running through Power Query and into Excel. The txt file is a simple format that has an item ID on one line and an error message on the next, eg: Item ABC Error Msg I...
- Apr 01, 2022
adinezza See attached.
Riny_van_Eekelen
Platinum Contributor
davidmaddock54 Thought of a quick-and-dirty way to fix it, though believe there should be a better way to do it.
SergeiBaklan
May 01, 2024MVP
I didn't dig your query, but it looks like result is not correct
rachel , we may simplify it to
let
Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
GroupedID = Table.Group(Source, {"ID"}, {{"Columns", each [Number]}}),
Result = Table.FromColumns( GroupedID[Columns], GroupedID[ID] )
in
Result
davidmaddock54 , if order of numbers in the source doesn't matter, perhaps it's better to sort them in columns as in next query in attached attached
- Riny_van_EekelenMay 01, 2024Platinum Contributor
SergeiBaklan Oops! Must have been confused.
- rachelMay 02, 2024Steel Contributor
Thank you! the code is so straightforward and self explanatory!
By comparison, the code generated by pressing "Group By" button now looks like a mess!