Forum Discussion
Dynamically Change the Database name in the Powerbi desktop
Hi lbendlin ,
My requirement is we have multiple customers and for each customer we have seperate database. So for each customer the report template will be same but we have to dynamically the change the database for each customer so that correct data will be displayed. For implementing this I used - parameters and given dynmaically the database name and server name in the sources. But while calling the report using powerbi rest api , even if I pass different datasource credential - it's still getting the same data for the database which I given as the current value.
Please help me to resolve this
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.
- AjithPrasath1 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]"])