cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
marijnfeijen Frequent Visitor
Frequent 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

Accepted Solutions
Super User
Super User

Re: Connect to Dynamic Named File

@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 Datanaut !





View solution in original post

2 REPLIES 2
Super User
Super User

Re: Connect to Dynamic Named File

@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 Datanaut !





View solution in original post

marijnfeijen Frequent Visitor
Frequent Visitor

Re: Connect to Dynamic Named File

@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
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)