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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
wjey9f
Regular Visitor

Dynamic Data Source Refresh in Power BI Service

I am trying to schedule a refresh from a csv file located on a network drive that is updated daily with a date stamp at the beginning.  Below is the current dynamic input that allows me to refresh within Power BI Desktop but I am needing to schedule this on the server.  Is there any way to build this in a way that will allow for scheduling on Power BI Service? 

 

The file name is structured with yesterday's date in 'YYYYMMDD' format followed by '_P1.SURVEY_CONTACTS.csv'

 

= Csv.Document(File.Contents("O:\library\Surveys\Archive\"
& Number.ToText(Date.Year(DateTime.LocalNow()))
& Number.ToText(Date.Month(DateTime.LocalNow()), "D2")
& Number.ToText(Date.Day(Date.AddDays(Date.From(DateTime.LocalNow()), -1)), "D2")
& "_P1.SURVEY_CONTACTS.csv"),[Delimiter=",", Columns=24, Encoding=1252, QuoteStyle=QuoteStyle.None])

2 REPLIES 2
GilbertQ
Super User
Super User

Hi @wjey9f 

 

As far as I know it is not possible to use a dynamic data source because it will always first try and detect the file. When it is dynamic it cannot do that.


With that been said, what you could do is to rather browse the local folder which will be the same folder. Then dynamically you can filter the files for your file name as based above?





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

Proud to be a Super User!







Power BI Blog

This worked to set up the refresh schedule!  Thank you!

 

One part I forgot to mention is that I was hoping the refresh would fail if files with that specific date stamp were not in the folder.  That way I could get an email notification that there was no file available.  Any chance you know a workaround for this?

 

I appreciate all your help!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors