Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Darko_Giac
Helper II
Helper II

Importing continuous CSV files from folder with different sheet names

Hi all,

 

I'm having an issue with power query and had posted a similar question earlier, however the problem I'm running into is slightly different. 

 

I'm exporting survey data on a weekly basis (in .csv format) to track the number of participants over the next month.

 

The variables in the export will not change, and since the number of .csv files will grow over the next few weeks in the folder connected to powerquery, refreshing power query to get a quick update normally wouldn't be an issue.

 

However, each raw data export's sheet name will differ, and I was wondering if there is a way to by-pass that step. For instance, if one week, a file comes in with the sheet name "2018-11-01", but the following week's sheet is called "2018-11-02", I have to make sure that the sheet names are uniform across exports, (my work around at the moment is to open each exported csv file and renaming the sheet to "sheet"). Is there a way that power query can read in the updated data with different sheet names for .csv files?

 

I know there's a workaround if the file is .xls/.xlsx, however the code when I import a .csv doesn't allow me to specify a sheet name, instead, this is the code I am working with:

 

let
    Source = Csv.Document(#"Sample File Parameter1",[Delimiter=",", Columns=96, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
    #"Promoted Headers"

This would be in the "Transform Sample File From..." step. 

 

In summary, I'm just looking to not have to rename the sheet of each new export.

 

Thanks!

 

Darko

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

 

Thats a good video which may help you .. 

 

https://www.youtube.com/watch?v=pMQK1Zcc9jw

 

Its shows your how to filter a folder 

View solution in original post

v-cherch-msft
Employee
Employee

Hi @Darko_Giac

 

Here are some articles for your reference.

https://powerbi.tips/2016/08/load-multiple-excel-xlsx-files/

https://excelgorilla.com/power-bi/power-query/import-files-from-folder-with-power-query/

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-cherch-msft
Employee
Employee

Hi @Darko_Giac

 

Here are some articles for your reference.

https://powerbi.tips/2016/08/load-multiple-excel-xlsx-files/

https://excelgorilla.com/power-bi/power-query/import-files-from-folder-with-power-query/

 

Regards,

Cherie

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-cherch-msft and @Anonymous!

 

These both worked very well!

 

Darko

Anonymous
Not applicable

 

Thats a good video which may help you .. 

 

https://www.youtube.com/watch?v=pMQK1Zcc9jw

 

Its shows your how to filter a folder 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.