cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Import different excel files as different queries within the same folder

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?

3 REPLIES 3
Community Support
Community Support

Hi @huseyinadacik 

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.

Hi @huseyinadacik 

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.

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors