cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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 I
Super User I

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 I
Super User I

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
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors