Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi everyone,
I have a question regarding environment management in Power BI. I’m working with two different MongoDB databases that have the exact same structure but different data—one for testing and one for production. I’ve done all the data modeling, transformations, and report creation using the test database.
Now, when it’s time to move to production, do I have to redo everything using the production database, or is there a way in Power BI to simply switch the data source while keeping all the transformations and visuals intact, given that the structure is identical? I’m looking for the most efficient way to handle this kind of environment switch.
Thanks in advance for your help!
Solved! Go to Solution.
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.
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.
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
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
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.
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.
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
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
thank you for this response, I'll try that thank you again!
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 52 | |
| 41 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 108 | |
| 106 | |
| 39 | |
| 33 | |
| 25 |