Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I want to import all excel files in a folder as a different query but I couldn't get it. Combine all excel files into one query. I created a function, but I couldn't make to it.Is there a solution to the power query?
I don't understand your requirement.
If i connect to a folder with Power BI, then all files in this folder will be imported into Power BI.
Do you want each file in a single query(table)?
If so, you could create a new blank query, then enter M query in Advanced editor using function like Table.SelectRows.
Or something else?
Could you provide more details?
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.
@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.