Forum Discussion
Calling a function and function name is in a data row
- 6 years ago
I think I understand what your trying to do now... Don't use Expression.Evaluate, it will just make your life harder. Instead use something like:
Record.Field(Output, [Processor])([Folder Path] & [Name], [Publisher]) - 6 years ago
Oh I see what is missing...
Change:
GoogleGSMDailyProcessor = (fileName as text, publisherName as text) => GoogleGSMDailyProcessor,to
GoogleGSMDailyProcessor = (fileName as text, publisherName as text) => GoogleGSMDailyProcessor(fileName, publisherName),Also, if you hit the firewall issue in the online service, go to edit credentialls (for the dataset object, not the report itself) and set "Privacy level setting for this data source" to None
Hello,
I have just simplified my code and put everything in google drive.
https://drive.google.com/open?id=163K8dplI9xqc0cxYSkGFcdUfvD8LE1Ta
I put TestData folder under c:\ and everything should work.
Funny thing I found...
- In my original environment, I access .csv data source from MS Sharepoint. Original pbix will have issue loading data into Power BI Desktop and no problem in preview in Power Query as Artemus mentioned. However, in this newly created pbix which uses local data, all data is loaded into Power BI Desktop correctly even with #shared command.
- In my original environment, using manually-created function record will cause an error mentioned previously "Formula.Firewall: Query 'GenerateOutput' (step 'Invoked Custom Function') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.". But in this newly created pbix, there won't be any error, instead column value becomes "Function".
If it is credential issue, it will be a whole new question then...
I think I understand what your trying to do now... Don't use Expression.Evaluate, it will just make your life harder. Instead use something like:
Record.Field(Output, [Processor])([Folder Path] & [Name], [Publisher])- primolee6 years agoHelper V
artemus wrote:I think I understand what your trying to do now... Don't use Expression.Evaluate, it will just make your life harder. Instead use something like:
Record.Field(Output, [Processor])([Folder Path] & [Name], [Publisher])Hello Artemus,
I just did what you said, and the result is the same as my previous reply. Values of this new column becomes "Function" instead of "Table".
Last mile here now... 😣
Best regards,
David
- artemus6 years agoMicrosoft Employee
Oh I see what is missing...
Change:
GoogleGSMDailyProcessor = (fileName as text, publisherName as text) => GoogleGSMDailyProcessor,to
GoogleGSMDailyProcessor = (fileName as text, publisherName as text) => GoogleGSMDailyProcessor(fileName, publisherName),Also, if you hit the firewall issue in the online service, go to edit credentialls (for the dataset object, not the report itself) and set "Privacy level setting for this data source" to None
- primolee6 years agoHelper VHello Artemus,
GoogleGSMDailyProcessor = GoogleGSMDailyProcessor,
I actually figured it out also this afternoon by changing to the above, works as well. 🙂
Last step is to make this record dynamically as number of pre-made functions will keep growing and I don’t want to manually entering the above whenever a new function is made.
Thank you so much for your time and help!
Best regards,
David - artemus6 years agoMicrosoft Employee
That won't work, you can't refer to any other query dynamically unless you have already done so explicitly in the same query. When you load it into the Power Bi model, all other queries that are not referenced will not resolve. This is why you should have a single query with all function in a single master record, and any new ones need to be added there first.
In theory you could also load the definitions from github or VSTS, but your millage will vary.