Forum Discussion
Switching Between Test and Production Databases in Power BI
- 1 year ago
You don't need to redo everything just create two parameters one for test and one for prod, just follow the below steps
Steps to Switch MongoDB Environments in Power BIStep 1: Create a Parameter
-
Go to Home in Power BI Desktop.
-
Select Manage Parameters, then choose New Parameter.
-
Name it something like MongoDB_URI.
-
Set the Type to Text.
-
Enter your test MongoDB connection string (e.g.,
mongodb://test-server:27017) as the Current Value. -
Click OK.
Step 2: Use the Parameter in Power Query
-
Go to Transform Data to open Power Query Editor.
-
Find your existing MongoDB source step in the query (usually called Source).
-
Replace the hardcoded URI with the parameter:
MongoDB.Contents(MongoDB_URI) -
Click Close & Apply.
Step 3: Switch to Production
-
Go back to Manage Parameters.
-
Change the MongoDB_URI value to your production MongoDB URI (e.g.,
mongodb://prod-server:27017). -
Apply the changes.
-
Refresh your data.
For better understanding follow the below video:
https://www.youtube.com/watch?v=OnaDJkGOmIE
-
-
-
You don't need to redo everything just create two parameters one for test and one for prod, just follow the below steps
Steps to Switch MongoDB Environments in Power BI
Step 1: Create a Parameter
-
Go to Home in Power BI Desktop.
-
Select Manage Parameters, then choose New Parameter.
-
Name it something like MongoDB_URI.
-
Set the Type to Text.
-
Enter your test MongoDB connection string (e.g.,
mongodb://test-server:27017) as the Current Value. -
Click OK.
Step 2: Use the Parameter in Power Query
-
Go to Transform Data to open Power Query Editor.
-
Find your existing MongoDB source step in the query (usually called Source).
-
Replace the hardcoded URI with the parameter:
MongoDB.Contents(MongoDB_URI) -
Click Close & Apply.
Step 3: Switch to Production
-
Go back to Manage Parameters.
-
Change the MongoDB_URI value to your production MongoDB URI (e.g.,
mongodb://prod-server:27017). -
Apply the changes.
-
Refresh your data.
For better understanding follow the below video:
https://www.youtube.com/watch?v=OnaDJkGOmIE
-
-
- raaan121 year agoFrequent Visitor
thank you for this response, I'll try that thank you again!