Showing results for 
Search instead for 
Did you mean: 
aront Regular Visitor
Regular Visitor

Storing Power Query M queries in Git?

So I realize many people come to Power BI from the Excel world. But I am sure there are lot's of people coming from the open source world. From our perspective a query is a little program and programs should be managed in a SCCS like Git. That way I can version queries, share them with others who can make changes and import them into whatever report I need them.


Here is another scenario where storing in something like Git is so important: In Excel and O365 you can store power queries in a Power BI site - but that is a disaster. I did it once, my Excel file crashed and I lost 2 hours of query work. I said to myself, great I saved them on O365 I can just reuse them - but of course all I got back was a link to some internal binary. The "original" query is stored in the Excel file but since that file crashed and burned without having a recoverable backup of the lost work - all that work went down the tubes.


I did find this little post online, but the approach seems to require you have the text file in a local directory, so I'm not sure its relevant for published reports on


Anyone have any good ideas besides copy/paste functions into reports?


If not, I will add it as a feture request and anyone interested can upvote it.



Super User
Super User

Re: Storing Power Query M queries in Git?

Are you referring to "Send to Data Catalog"?

I have book! Learn Power BI from Packt

Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Power BI Team curth
Power BI Team

Re: Storing Power Query M queries in Git?

Please do file this as a feature request. Of course, nothing prevents you from storing code in GitHub and copying it manually into your query -- but this is obviously tedious and error-prone. I personally keep code samples at

aront Regular Visitor
Regular Visitor

Re: Storing Power Query M queries in Git?

When I was talking about the problems I had in Excel - yes I was referring to send to Data Catalog!


And I have opened a request for this feature.

aront Regular Visitor
Regular Visitor

Re: Storing Power Query M queries in Git?

potyarkin Occasional Visitor
Occasional Visitor

Re: Storing Power Query M queries in Git?

I too consider it essential to manage any source code with version control system. I was rather disappointed to find out there is no easy way to do so with Power Query.


That's why I have started the LibPQ project: It enables you to store source code in local files or on the web server, and to load those modules into your workbooks.


I hope you'll find it useful too.

Helpful resources

Community Highlights

Community Highlights

Find out what's new in the Power BI Community!

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 285 members 3,249 guests
Please welcome our newest community members: