Importing a folder containing CSV files and referencing each file using M code

Hello,

I have a folder containing CSV files and I want to write some M Code to merge some files together but I can’t get it.
Here is a sample of what I want to achieve


The database was imported as the source and they reference each table from the source variable
This is my folder

but here is my script

Please help out. Thank you

Bumping this post for more visibility from our experts and users.

Could you please provide more details about your question? It would be helpful if you could provide a sample file or describe the specific problem you are facing. Additionally, if you can provide an example of the expected result, it would assist me in understanding your requirements better.

1 Like

Hi @Mubar

I noticed you didn’t provide a PBIX file. Providing one will help users and experts find a solution to your inquiry faster and better.

A perfect initial question includes all of the following:

  • A clear explanation of the problem you are experiencing
  • A mockup of the results you want to achieve
  • Your current work-in-progress PBIX file
  • Your underlying data file (to allow us to go into Power Query if necessary to transform your data and/or data model – often DAX questions really end up being data modeling solutions)

Check out this thread on Tools and Techniques for Providing PBIX Files with Your Forum Questions

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.

Please also check the How To Mask Sensitive Data thread for some tips on how to mask your pbix file.
Not completing your data may sometimes cause delay in getting an answer.

Thank you!

Hello @Mubar

We notice that no response was received from you on the post above.

We are waiting for your masked demo pbix file and other supporting links and details so other users can help you in your query.

Due to your inactivity, we’ll be tagging this post as Solved.

Should you wish to add your masked demo pbix file and other supporting links and details, you can reopen this thread.

Thank you!