Skip to main content

Power BI

New

convert table queries to parameters

Vote (24) Share
Ankit Patira's profile image

Ankit Patira on 11 Jun 2016 09:48:56

Recently introduced Convert Query to Parameter feature is not allowed for all types of queries such as one that returns table. Allow ability to convert those type of queries to parameters.

Comments (2)
Ankit Patira's profile image Profile Picture

ce6e0a94 865a-403a-9fda-b274ea8db63e on 05 Jul 2020 23:35:36

RE: convert table queries to parameters

I was able to do this by hand:
1) Use Advanced Editor to examine an existing parameter, e.g.:

0 meta [IsParameterQuery=true, Type="Number", IsParameterQueryRequired=true]

2) Create a blank query, and use the advanced editor to define the default with a table query, and the type as "Any", e.g.:

ExistingTableQuery meta [IsParameterQuery=true, Type="Any", IsParameterQueryRequired=true]

3) Give the parameter "query" a name, and reference it from a query that has been converted to a function.

Result: The updated function should be able to use the parameter as a table.

Note that the "edit parameter" UI will show a warning simple, since it only expects some sort of primitive type. Avoid that UI as it might corrupt the definition and turn it into a string or something like it.

Ankit Patira's profile image Profile Picture

f030e6ba 0920-e911-a969-000d3a4f3343 on 05 Jul 2020 23:07:41

RE: convert table queries to parameters

This feature will enable basic users to convert queries into functions, and use other tables or lists as the input for these functions.