Forum Discussion
Import different excel files as different queries within the same folder
v-juanli-msft Thanks for your interest
I want each excel file to be a different query automaticly when I select a folder. There are no tables in the excel files. Each page has ranges. My folder contains A,B,C workbooks . A workbook has sheet1,Sheet2 and Sheet3.others have the same pages.When I select the folder I want to merge the pages in file A into Query 1,merge the pages in file B into Query 2 and merge the pages in file C into Query 3.
Thaks for your help.
You could use Get data->Excel connector to connect to each file,
In the pop window, you could select all pages(sheets) in a file,
Then select "Edit", go to Edit queries,
Select Home->merge queries/ Append queries,
then all sheets in a file can be combined in s single query.
After that, you could create anthor blank query,
paste the code in Advanced editor of previous step in the Advanced editor of this new blank query,
Change the path to another file.
You could create a quey parameter to change the file path dynamically and quickly.
Reference:
Power BI Desktop Query Parameters, Part 1
power bi using parameters for flat file csv excel sources/
Deep Dive into Query Parameters and Power BI Templates
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.