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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Load multi folder by M Code ?

 

Hi All

 

I have sales order table in CSV file for 10 company . All load by folder.

 

I also have GL table in CSV file for same 10 company Can I create a PBI file = sales order by load all table using folder.

 

And I also create a PBI file = GL by load all table using folder.

 

Once above 2 step successful then I combine the above 2 PBI file M code , so now my sales order and GL both table combine in one PBI file. It above approach have any issue in future ?

Paul

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Anonymous ,

If the files under the folder have the same file type like .csv etc. , you can combine them when connecting to the folder in power query.

Refer:

  1. Load but not combine multiple files from a folder 
  2. Combine files in a folder with Combine Binaries (Power Query) 
  3. Import Multiple Files from a Folder with Power Query 

 

If the folders have some 'relationships' like parent-child etc. ,you can follow these steps to combine:

      1. Get data from the parent folder.

      2. Add filter to find out ther related folder.

let
    Source = Folder.Files("C:\Users\xxxxxx\Desktop"),
    FolderFilter= Table.SelectRows(Source, each [Folder Path] = "C:\Users\xxxxxx\Desktop\file\" or [Folder Path] = "C:\Users\xxxxxx\Desktop\Read\"),
    NameFilter = Table.SelectRows(FolderFilter, each [Name] ="abc.xlsx" or [Name] ="cde.xlsx" )
in
    NameFilter

Refer:  Combine multiple "FOLDERS" (not files) 

 

Best Regards,
Community Support Team _ Yingjie Li
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-yingjl
Community Support
Community Support

Hi @Anonymous ,

If the files under the folder have the same file type like .csv etc. , you can combine them when connecting to the folder in power query.

Refer:

  1. Load but not combine multiple files from a folder 
  2. Combine files in a folder with Combine Binaries (Power Query) 
  3. Import Multiple Files from a Folder with Power Query 

 

If the folders have some 'relationships' like parent-child etc. ,you can follow these steps to combine:

      1. Get data from the parent folder.

      2. Add filter to find out ther related folder.

let
    Source = Folder.Files("C:\Users\xxxxxx\Desktop"),
    FolderFilter= Table.SelectRows(Source, each [Folder Path] = "C:\Users\xxxxxx\Desktop\file\" or [Folder Path] = "C:\Users\xxxxxx\Desktop\Read\"),
    NameFilter = Table.SelectRows(FolderFilter, each [Name] ="abc.xlsx" or [Name] ="cde.xlsx" )
in
    NameFilter

Refer:  Combine multiple "FOLDERS" (not files) 

 

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

 

Anonymous
Not applicable

Hi Ying

Thank you for sharing.

Paul

Fowmy
Super User
Super User

@Anonymous 

Once you bring all the queries under one table as you have followed, there will not be an issue. 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors