Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Switching between development and production databases in Power BI can often be a hassle — especially if you're manually editing PBIX files every time. But what if you could dynamically change the database connection directly from the Power BI Service?
In this blog, I’ll show you exactly how to make your SQL Server connection dynamic using parameters, allowing seamless switching between databases without downloading your PBIX file.
💡 When Is This Useful?
This approach is ideal when:
📝 Blog Overview:
Step 1:
In Power BI Desktop, go to Home > Get Data > SQL Server.
Step 2:
In the connection dialog:
Step 3:
Enter your SQL credentials.
Step 4:
In the Navigator pane, select the required tables and click Transform Data to enter Power Query Editor.
2️⃣ Create Parameters
In Power Query Editor:
Step 1:
Go to Manage Parameters > New Parameter.
Step 2:
Fill out the details:
🛠️ Example:
Step 1:
In Power Query Editor, select any table and open Advanced Editor from the Home ribbon.
Step 2:
You’ll see the M code. Locate the part that defines the source, like:
Source = Sql.Database("dev-server", "SalesDev")
Replace the hardcoded values with your parameters:
Source = Sql.Database(ServerName, DatabaseName)
Click Done, then Close & Apply.
🔄 In Power BI Desktop:
🌐 In Power BI Service:
⚠️ Note: In Power BI Service, dropdowns won’t appear — but manual entry works just fine.
✅ Final Thoughts
This method is a life-saver for developers and admins, making it easy to:
📢 Let’s Connect!
Best regards
Anmol Malviya
Sr. Data Analyst | Addend Analytics
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.