Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Parameters in Direct Query

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. ...
  • GilbertQ's avatar
    GilbertQ
    6 years ago
    Hi there

    As far as I know there is nothing else at the moment unfortunately.
  • Anonymous's avatar
    Anonymous
    6 years ago

    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-

    https://github.com/mycodehub2205/Powershell-For-PowerBI/commit/eb1263699640beb6ec33a822c45a0c56190a78b1

     

    If i answer your question marked as solved..