Forum Discussion

jusTodd's avatar
jusTodd
Icon for Advocate IV rankAdvocate IV
4 years ago

Get most recent file for a report from Folder

Is there a more elegant solution than removes the risk of a missed step?

 

Currently, I have a folder with multiple CSV that feed 5 other reports in one PBIX.

 

In that same PBIX, I have one report that only views the most recent CSV in that folder.

 

Each time the data is refreshed, I change the filter for that one report to view the most recent file.  

 

I do not want to do that previously mentioned step.  I want Power BI to automagically know I want that.

 

This data was no other relationships beyond itself, fortunately.

 

Searching around, all other options appear geared towards pushing the whole PBIX to only look at one file.  I need the other data too.    I found the following article and gave it a twist ... bascially, new query for only the most recent file, copy the transformations, and wire the one report up to that query.  (https://wkrzywiec.medium.com/getting-data-from-the-latest-file-in-a-folder-using-power-query-51dfa4bff711)

 

It works, but I had to copy/paste all the transformations frome the previous query into this new query.   If further changes are required on the original query, I do not want to have to go to the other query and repeat it ... though it probably is not that big of a deal, unless I forget.

 

Thanks in advance for any thoughts on this.  

2 Replies