Forum Discussion
AjithPrasath
2 years agoResolver II
Dynamically Change the Database name in the Powerbi desktop
Hi All, I am trying to change the database name dynamically in the powerbi from the powerbi rest api call. I created parameters for server and database name and use that in the query . I am ...
lbendlin
1 year agoSuper User
For implementing this I used - parameters and given dynmaically the database name and server name in the sources.
You cannot do that. Use a fixed server and database name for the base connection definition, and then swap out the database name in the custom SQL query.
AjithPrasath
1 year agoResolver II
Thanks for the reply. Can you elaborate on that swap out the database name in the custom sql query?
- lbendlin1 year agoSuper User
let Source = Sql.Database(server, database1, [Query="Select * from [database2].[schema].[table]"])