The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
78 | |
77 | |
44 | |
38 |
User | Count |
---|---|
150 | |
116 | |
68 | |
64 | |
58 |