Nasim_elMasoudi
4 years agoNew Member
Status:
New
Making user defined functions available in the PowerBI REST API
Hi,
We already raised a request to Microsoft in regard to making user defined functions available in the PowerBI REST API. I Below are the details which we provided to Microsoft:
For example we create the following Power Query function:
Custom function definition: = (fileName as text) => let filePath = "D:\work\power_bi_cloud\" & fileName in filePath
and then we use this function inside some table Power Query script as below:
Custom function usage: let Source = Csv.Document(File.Contents(GetFilePath("Source.txt")),[Delimiter=",", Columns=2, Encoding=1250, QuoteStyle=QuoteStyle.None]), #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]), #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"S1", Int64.Type}, {"S2", Int64.Type}}) in #"Changed Type" We are using the following API to scan workspaces: https://docs.microsoft.com/en-us/rest/api/power-bi/admin/workspace-info-get-scan-result and we can see the following result:
Exported json excerpt: { "id": "f4eaa351-3276-4b0d-b231-c3b295a9948b", "name": "Custom Function", "tables": [ { "name": "Source", "columns": [ { "name": "S1", "dataType": "Int64", "isHidden": false, "columnType": "Data" }, { "name": "S2", "dataType": "Int64", "isHidden": false, "columnType": "Data" } ], "measures": [], "isHidden": false, "source": [ { "expression": "let\n Source = Csv.Document(File.Contents(getFilePath(\"Source.txt\")),[Delimiter=\",\", Columns=2, Encoding=1250, QuoteStyle=QuoteStyle.None]),\n #\"Promoted Headers\" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),\n #\"Changed Type\" = Table.TransformColumnTypes(#\"Promoted Headers\",{{\"S1\", Int64.Type}, {\"S2\", Int64.Type}})\nin\n #\"Changed Type\"" } ] } ] But there is no source code of getFilePath function available anywhere in this json file. We haven’t found any other API that will get us this information.
Please vote for this idear! Thank you in advance.
1 Comment
- fbcideas_migusrNew MemberStatus added:New
Recent ideas
Reintroduce Tenant/Capacity Switch to Control "Users can create Plan items" Post-GA
During the Preview phase of Fabric Plan items, administrators had access to a dedicated tenant/capacity setting: "Users can create Plan items". With General Availability (GA), this granular administr...Sri-Surendra_Ku1 hour agoNew MemberNew97Views13likes1CommentSupport Fabric SQL Database with workspace-level inbound Private Link
Fabric SQL Database supports tenant-level Private Link but not workspace-level Private Link. Securing a small number of databases therefore requires enabling Private Link across the entire tenant, in...WorkFull223 hours agoAdvocate INew8Views1like0CommentsImprove Relationship UI Wording to Better Reflect Filter Propagation Direction
The current relationship dialog can be confusing because the UI labels "From" and "To" do not always align with users' linguistic expectations regarding filter propagation. As per document : Relation...v-varunvv4 hours agoMicrosoft EmployeeNew14Views4likes0CommentsDynamic ADLS-Gen2 path input for Spark Jobs Main definition file
I would like the ability to add a dynamic input box on a spark job definition's "Main Definition File" "ADLS-Gen2 path". this would be useful to set base and variable paths across all spark jobs...mfink_db4 hours agoNew MemberNew224Views2likes1Comment