Forum Discussion
Refreshing queries with functions doens't work
- 11 years ago
Maybe try this approach..and filter the latest file by date created..Needs more code but it worked - refreshed in PowerBI V1 so probably it will work in V2 as it doesn't use parameters..
This is currently correct; queries where data access happens inside a function and where the data source is dependent on parameters to the function can't currently be refreshed. That's because we're doing static analysis of the query to discover the data source, and our static analysis can't yet handle this scenario.
any timetable on that? depending on the size of my reports without functions code gets a mess really fast...
- curth11 years agoPower BI Team
Do you need the ability to call the same function multiple times? That is, does your code look more like
let
function = (url) => Web.Contents(url),
result = function("http://foo.com/bar"),
in
result
or like
let
function = (url) => Web.Contents(url),
result1 = function("http://foo.com/bar"),
result2 = function("http://foo.com/baz"),
result = Binary.Combine(result1, result2)
in
result
?
- bloigge11 years agoAdvocate IV
Like the second one. In one of my reports I have a folder with alot of excel files, which are exported from another software. The structure of the files is always the same. The files are exported every day and in the naming of a file there is the current date - so the naming changes from day to day.
My approach is to query the parent folder, sort the files by date and remove all files except the newest. Then I insert a new column and call a function on the filepath of my filtered excel files. I have to do that, because the excel files have a bad structure so the table in a single file has to be rearanged before I can combine.
The problem is that the amount of files changes from day to day. So for example on monday there are more files to query than on a saturday.
My case is more or less like in this powerQuery tutorial: https://youtu.be/KXxUDWwo0pg?t=2015
- konstantinos11 years agoMemorable Member
Maybe try this approach..and filter the latest file by date created..Needs more code but it worked - refreshed in PowerBI V1 so probably it will work in V2 as it doesn't use parameters..