Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi,
I'm trying to combine a set of files saved in SharePoint folder. Files are CSV file type and are same column headers in each file. A new CSV will be saved in the folder each day for the previous day. The issue I'm having is that while Power Query is pulling in all the data it's not recognizing the header row in the CSV files so when combining multiple files it's pulling in header rows multiple times which I don't want obviously. When doing the initial step to combine files the below appears and there is no GUI option to promote headers at this step and I'm newer to Power Query so not sure where to manually insert M code or what that code should even be.
Anyone see this before or have a workaround solution or am missing something?
Appreicate any assistance in resolving!
Thanks!
John
Solved! Go to Solution.
I assume you are using the Combine & Edit functionality to combine your csv files, where a function and query from a selected example file is auto generated. If so, you can just add a Promote Headers step in the example file query, which will auto update the function and apply it in your main query.
If not, you can create a custom column on your table of Binary files and use Table.PromoteHeaders(Csv.Document(... to extract the table of data from each file with the headers already promoted.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous I was encountering a similar issue and I could not figure out why none of my previews and imports were not promoting headers. Turns out I had an option checked from power query to disable this function. I don't know how that happened. From Power Query, click File-->Options and Settings-->Options-->Data Load --> Type Detection--> Always detect column types and headers for unstructured sources
I assume you are using the Combine & Edit functionality to combine your csv files, where a function and query from a selected example file is auto generated. If so, you can just add a Promote Headers step in the example file query, which will auto update the function and apply it in your main query.
If not, you can create a custom column on your table of Binary files and use Table.PromoteHeaders(Csv.Document(... to extract the table of data from each file with the headers already promoted.
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Thank you!
So I did come up with one workaround solution to just promote headers and to then filter out the duplicate header rows. Would still prefer to learn how to get it to work the "right" way though either using the GUI correctly to acheive straigth away or M code modifications that might be needed. Thanks.
User | Count |
---|---|
116 | |
73 | |
62 | |
50 | |
46 |
User | Count |
---|---|
173 | |
123 | |
60 | |
59 | |
57 |