Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
JWA___
Regular Visitor

Bulk update M code in Power Query

Hi

 

I have a dataset with many facts and dimensions pointing to a Synapse SQL database.

The data is moved to Azure Databricks, which means I need to update all my PQ queries. This is not a matter of updating the Parameter as it requires a different function (Source = Databricks.Catalogs() instead of Source = Sql.Database()).

 

I have tried to copy all my queries to a Notepad to Find & replace the source lines, however after that I cannot Paste back the updated queries to PQ, nor import them anywhere.

 

Any ideas on how to resolve this?

5 REPLIES 5
JWA___
Regular Visitor

I obviously can do that one by one, but I have a few datasets with multiple queries each and would love to find a way to bulk update my queries instead of updating them one by one in the advanced editor.

With the new Developer Mode you can export all your pbix to pbib (and its folders) and each model.bim file contains the definition of the source of your query's data. Using some tool (don't know how to do that in Windows) you should be able to update all the strings at once. Then you can save once again the pbib project to pbix and republish it.

This sounds interesting and hopeful! ...but goes beyond my current knowledge. I am not familiar with Developer Mode pbib files. Have heard of bim files, but not sure how to get these or what to do with it, etc.

Would you mind to elaborate or alternatively share some blogs or YT videos that explain more step by step how to do this, please?

Thanks!

Here you can start digging: Power BI Desktop developer mode documentation - Power BI | Microsoft Learn

Most of the files, including the .bim ones, are plain text so you don't need any special tool to edit them. We can't publish the pbib projects to the service yet, although I've seen some insider comments saying that it will be possible in not a too far future, but today we still have to first resave it to pbix.

 

jsanchezm
Frequent Visitor

Hi,

I'm not sure I really get where your problem is: you mean you cannot create a new blank query and paste your updated code in it using the Advanced Editor?

 

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors
Top Kudoed Authors