Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi
I have imported an excel report into power bi by copying and adjusting query code in advanced editor. All those querys and connections work fine in desktop version, now when I want to schedule a refresh for this report I get this:
You can't schedule refresh for this dataset because the following data sources currently don't support refresh:
Data source for 1
Data source for 2
Data source for 3
Data source for 4
Data source for 5
Data source for 6
Data source for 7
Data source for 8
Data source for 9
Data source for 10
Data source for 11
Data source for 12
Data source for 13
Data source for "14"
Data source for 15
Discover Data Sources
Query contains unsupported function. Function name: File.Contents
for example:
Query in Data source for 1&2:
let
Source = #"14",
....
Query in Data source for 14:
let
Source = Folder.Files("Path to the folder"),
Folder.Files uses long UNC parent folder path ( folder exists in network disk ) and the path is added to gateway. Still no change. I've googled it and as I can understand adding the path to gateway should fix the problem.
Error shows only querys that link source to another query or has source = Folder.Files. Web.Contents and AnalysisServices queries seem to be fine.
Weird thing is the only query I have that uses
let
Source = Excel.Workbook(File.Contents
is not listed in the error list "You can't schedule refresh for this dataset because the following data sources currently don't support refresh:"
and does not appear to be connected with other queryes either.
Hi @Anonymous ,
You should change all data sources to the same format as below:
let
Source = Excel.Workbook(File.Contents("xxxxxxxxxxxxx"), null, true),
It is by default when you load excel file to power bi desktop whether you use a local disk or a network disk.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
All data sources?
Do you mean I should also change
let
Source = Folder.Files("Path to the folder"),
into
let
Source = Excel.Workbook(File.Contents("Source path"), null, true),
Because that doesn't make a lot of sense since the files are not excel files but .txt files.
Only excel file it connects to is 1 query ( which doesnt show in the error ) and it has the same format as you wrote.
At first when I wrote that I recreated an excel file into PowerBI doesn't mean I am acctually linking to that excel file, instead I made querys just like in that excel file. These querys get data from .txt files, analytics cubes and a websource.
In my first post the error shows in queries from 1 to 15. These querys mostly has source to another query. For example query 1 source is query 14, query 2 source is query 14 and query 14 source is a .txt file that automatically updates every 1h:
let Source = Folder.Files("Path to the folder"),
So since I can't schedule a refresh for example to query 14 that connects to a .txt file that means my other querys that connect to query 14 obiously can't refresh either.
So now I don't understand why the error code says:
Query contains unsupported function. Function name: File.Contents
while the querys that were listed ( query 1-15 ) in the same error do not contain such function.