March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hey folks,
I've tried to figure this out myself and searched everywhere for a solution, to no avail. I am exporting reports in CSV format from Microsoft Dynamics 2016 and it outputs the report data in a very annoying format:
Table0_Header0,Table0_Header2,Table0_Header4,Table0_Header5,Table0_Details0,Table0_Details2,Table0_Details4,Table0_Details5
Name,Age,Gender,Location,John Doe,23,Male,Someplace
Name,Age,Gender,Location,Mary Sue,49,Female,Nowhere
Name,Age,Gender,Location,Bob Joans,37,Male,Outhere
How do I convert this structure into a sensible table programtically using Power Query? Like so:
Name | Age | Gender | Location |
John Doe | 23 | Male | Someplace |
Mary Sue | 49 | Female | Nowhere |
Bob Joans | 37 | Male | Outhere |
I have a lot of reports that are exported so the solution needs to work for different numbers of Header+Details sets, e.g., there could be 4 header+details sets (like here), or 8, or 20, etc.
Solved! Go to Solution.
Hi @AdrianJ , See the Solution in the attached .pbix file. Look at the Power Query section for transformation steps. I seperated the headers and details then appended the detail rows to header. This should work for any number of columns you may have in your output files.
Proud to be a Super User!
Hi @AdrianJ , See the Solution in the attached .pbix file. Look at the Power Query section for transformation steps. I seperated the headers and details then appended the detail rows to header. This should work for any number of columns you may have in your output files.
Proud to be a Super User!
Fantastic amustafa, thank you very much!
Splitting it out in a Header table and Detail table and then recombining it was an inspired approach. Thank you again for the help :).
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
86 | |
77 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |