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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Connect to Dynamic Named File

Hi all,

 

At this moment I am building a new report based on several csv-files. However, these excel files are named dynamically. All the files are automatically saved in two folders:

  • Current Month
  • Previous Month

Now the problem lies that I would like the report to automatically connect and import the files on these locations. The files are named dynamically in the format:

  • YYYY[MonthName]PowerBI_HFM_Customer_Data.csv    (2019AugustPowerBI_HFM_Customer_Data)
  • YYYY[MonthName]PowerBI_HFM_Customer_Eur.csv       (2019AugustPowerBI_HFM_Customer_Eur)
  • YYYY[MonthName]PowerBI_HFM_Supplier_Data.csv        (2019AugustPowerBI_HFM_Supplier_Data)
  • YYYY[MonthName]PowerBI_HFM_Supplier_Eur.csv           (2019AugustPowerBI_HFM_Supplier_Eur)

So the next month, August changes to September, etc. etc. The files from August will then be moved to the folder "Previous Month".

 

Is there any way to connect to these files based on a wildcard?

For example, it would be a possibility to select the files where the filename ends on "Customer_Data" / "Customer_Eur". However I have not been able to find how to do this in PowerBi.

 

(In QlikSense this is possible by using a $ character as wildcard: FROM [lib://Previous Month\$HFM_Customer_Data)

 

Thank you in advance for your help!

Very much looking forward to your solutions.

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Anonymous Did you tried using the "Folder" option available under "Get Data" ribbon instead of accessing direct source file as source.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

2 REPLIES 2
PattemManohar
Community Champion
Community Champion

@Anonymous Did you tried using the "Folder" option available under "Get Data" ribbon instead of accessing direct source file as source.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Anonymous
Not applicable

@PattemManohar thank a lot for your reply.

The solution was indeed (as simple as) to connect to the folder instead to the individual files.

 

Now I connected to the folder, and filtered the loaded files in the Query Editor so that only the files ending with "Customer_Data.csv", "Customer_Eur.csv", Supplier_Data.csv" or "Supplier_Eur.csv" are loaded.

 

In order to have these files as seperate tables I have duplicated the query (8 times, 4x for current month and 4x for previous months) and filtered based on the added column "SourceName" 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.