Forum Discussion
Data transformation using Power Query?
Hi Lorenzo
I used the code in your file but am getting an expression error: "There weren't enough elements in the enumeration to complete the operation."
Details:
[List]
The only change I made was the Source = myFilename (instead of SourceTable) in the Linage table.
The blank rows are not needed, I just added for ease of reading the data.
My goal is to see the data in 1 row/multiple columns for each Source Column, instead of multiple rows.
Can you please let me know what changes are needed to get your code to work?
Thanks again!
Hi MT_1909
What changes are needed to get your code to work?
It works (at least it doesn't raise Errors) with the sample (copy/paste of what you shared + a couple of other records I added for testing) in the workbook I shared. IMHO you go a bit too fast if I may. You know what you have (your actual data) and know +/- exactly what you expect. On the other hand helpers on forums have to understand... And until they get the right understanding + some representative actuals chances are high that they shoot in the dark
#1 My goal is to see the data in 1 row/multiple columns for each Source Column
In principle I understand what you want to do but let's confirm with a single set of records in A1:F5 below:
#1.1 The Source Column you talk about is the one highlighted in dark orange (col. C) ???
#1.2 Data in A3:C3 are "ignored"/shouldn't be reported ???
#1.3 Expected result in A1:O2 ???
#1.4 A few other ??? in attached file sheet Source
#2 "There weren't enough elements in the enumeration to complete the operation."
Many possibilities. I tried a few scenarios but none failed with that error so it's hihgly probable your actual data are not consistently structured as what you initially shared and/or exceptions exist in the dataset. Attach (if not allowed share with OneDrive, Google Drive... and post the shared link) a representative workbook that raises the error please
#3 The blank rows are not needed
OK, revised accordingly