March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello Team,
I want to change my local server to on premise server using dataset parameters. I have loaded data using direct query.
I could change my server with using parameter in import mode. I am trying to achieve same result with direct query but Power bi Service is not able to identify parameters when I use direct query. Please let me know how I can achieve this.
Solved! Go to Solution.
Yes by using rest api you can update parametrs in direct query.
Step 1- Take direct query mode and in advance option write a normal query.
Step 2- Go to adavance editor and change that query with parameter.
like
let
Source = Sql.Database("host name", "database_name",
[Query="select * from [schema name].["& paramter 1 & "_retailername_"& paramter2 &"] (NOLOCK)"])
in
Source
In the above example i chnage my direct query using parameter.
If you want to chnage thease parameters using powershell plz follow the following link-
If i answer your question marked as solved..
Bingoooo..
Got solution finaly...if you download latest version of power bi dekstop and publish the report.your parametrs are enable in services and you can make it dyanamic.
latest version link-https://www.microsoft.com/en-us/download/details.aspx?id=58494
version -2.82.5858.1161
@Anonymous I have tired this by downloading latest version 2.82.5858.1161 and published the report with direct query contains paramter but parameters are not showing up in power bi online(app.powerbi.com.) Could you please elobarate the steps furher if possible. Any references could be highly appreciated.
Just for your information, I am holding Trail Pro License. Is that really matters?
Thanks
Mohan Kumar
Hi @Anonymous i am not sure about trail pro License. Curruntly i am using pro license.
Step 1-Create a report in PBI desktop using latest version
step 2-In Get data-serverdetail-direct query-advance option -write plane sql query-done
step 3-Go to transform data-transform data-advance editor-change query with your paramter (dont use any filters)close and apply.
step 4- publish report.
Note-Desktop and services must use same user account.
please follow the below screenshot-
@GilbertQ please see the below screenshot where i created report using direct query and for same report i am able to pass parameter in services.
Hi @Anonymous
Is the SQL Server On-Prem or Azure?
Are you using any gateways?
@Anonymous Sql server not using any gateway.
Direct query with parameters only support sql server as data source.
if i answer your question mark as solved.
Thanks.
Hi @GilbertQ ,
Can we change Paramter values in direct query mode using PowerShell?
Yes by using rest api you can update parametrs in direct query.
Step 1- Take direct query mode and in advance option write a normal query.
Step 2- Go to adavance editor and change that query with parameter.
like
let
Source = Sql.Database("host name", "database_name",
[Query="select * from [schema name].["& paramter 1 & "_retailername_"& paramter2 &"] (NOLOCK)"])
in
Source
In the above example i chnage my direct query using parameter.
If you want to chnage thease parameters using powershell plz follow the following link-
If i answer your question marked as solved..
You can try to abuse the Deployment Pipeline parameterization for that. Direct Query is not listed in the limitations.
but, it requires premium capacity and my organization has pro license.
is there any other workaround?
@GilbertQ @Pravina2514 @Anonymous @Anonymous
After lots of research finaly found how to enable parameter in direct query.
follow the following setting in you power bi desktop latest version(June 2020)
File-Option and setting-Preview features-enable-store datasets using enhance metadata.
If it work mark as solution.
Thanks.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
24 | |
23 | |
12 | |
11 | |
8 |
User | Count |
---|---|
44 | |
44 | |
24 | |
12 | |
10 |