How to replace part of the M code in many queries at the same time
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)