This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi,
I inherited the responsibility to maintain a large PowerBI file that has more than 80 queries. It serves as a central dataset and presentation layer for many other reports. The previous owner hardcoded the connection to the SQL server in each individual queries. I want to use parameters.
Is it possible to do a search and replace to change the Source step in all the queries at once?
Something like this:
Search M code in all queries: Source = Sql.Database("server1", "database1")
Replace M code in all queries: Source = Sql.Database(ServerNameParam, DatabaseNameParam)
Thank you
Solved! Go to Solution.
Hi @molegris ,
it requires a bit of setup, but then you can bulk-replace strings in your M-code at once:
https://bengribaudo.com/blog/2020/07/16/5356/editing-report-spreadsheet-mashups-in-vscode
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Hi @molegris ,
it requires a bit of setup, but then you can bulk-replace strings in your M-code at once:
https://bengribaudo.com/blog/2020/07/16/5356/editing-report-spreadsheet-mashups-in-vscode
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Thank you. A bit complicated but I'll definitly try it and I'll let you know if it worked for me.
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 23 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 36 | |
| 30 | |
| 25 | |
| 21 |