Reputation: 463
I am new in power bi. I am using SQL connection for data load in power bi. I created the report in Dev environment. But I want to use the same report in all environment(dev/test/uat/prod). Question: Is it possible to switch the connection via button click in dashboard?
Upvotes: 0
Views: 1171
Reputation: 322
Its tricky question. Try with above answers, if those not work try with these approach.
I don't think for the moment they didn't implement solution for that. From my experience I had to create 3 dashboards and gateways to dev, test and prod dashboard.
If your dev,test,prod database column names are same you just copy past your dashboard and rename it according to that.
Then go to change data source and add new test env host and change schema to test env.
If you get few errors you have to resolve , check column names, host and finally you have to sync your data.
You can use same approach for the prod env .
once you publish, you can point to gateway for dev,test or prod environment.
Note: Establish gateway on your server.
Upvotes: 1
Reputation: 13440
Power BI offers Deployment Pipelines for this purpose. This tool will allow you to create 3 workspaces for dev, test and production stages. Then you can deploy from one stage to another by clicking a button in Power BI Service or using the REST API. In the pipeline you can define rules for dataset and parameters, which can be used to automatically change the datasource when deploying to the next stage, i.e. to change the datasource from your dev database to the test database, or from test database to production one.
You can also implement similar functionality using the API. See for example this answer.
Upvotes: 1
Reputation: 12295
You'll have to use a parameter to select the connection and store the report in template format - *.pbit. Then you can easily create different versions of the report from the template by specifying the according parameter setting.
The only way to use a slicer for changing the environment would be to load the data from all different environments into the model first - which is clearly not recommended.
Upvotes: 1