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
Paulyeo11
Impactful Individual
Impactful Individual

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 @Paulyeo11 ,

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 @Paulyeo11 ,

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.

 

Paulyeo11
Impactful Individual
Impactful Individual

Hi Ying

Thank you for sharing.

Paul

Fowmy
Super User
Super User

@Paulyeo11 

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
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.