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
marijnfeijen
Regular Visitor

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

@marijnfeijen 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

@marijnfeijen 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




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