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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
rafaelsmoreno
Frequent Visitor

M code formatter

Hi folks!

 

Just checking if any of you know a code formatter for M. I googled it but couln't find anything, so if you guys know one, please share in this post. 

 

Thanks in advance, 

 

6 REPLIES 6
mithra
New Member

Please check the following site

https://www.powerqueryformatter.com/

 

Geradav
Responsive Resident
Responsive Resident

It is now available!

https://powerqueryformatter.com/

 

Regards

Hi @Geradav this is great! I gave it a test out yesterday evening and one M query worked wonderfully, and the other didn't, but both run perfectly in Power Query with no syntax errors within PQ. Weird.🤔

 

I'll post the issues on Github once today's workload is done.

 

Cheers

 

Manfred

Hi Manfred,

 

yes, the PQFormatter is more or less in beta - still some functionality missing. Just send a bug report to github - we fix it, if we can 🙂

 

Holger

mwimberger
Resolver II
Resolver II

Hi @rafaelsmoreno 

 

Reza Rad has a Beautify M Script function in his tool https://radacad.com/beautify-m-script-and-extract-row-level-security-with-power-bi-helper-version-4-... 

 

Whilst it doesn't do a similar job to what the Dax Formatter (https://daxformatter.com ) does, and the newest updates to Power Query offer the Intellisense colour coding, this Power BI Helper tool does remove the extra tab paddings before lines, and offers the ability to get all your M code copied out in one place. Useful for archiving Queries.

 

There is also a way to get Notepad++ to have M language formatting https://community.powerbi.com/t5/Community-Blog/Get-your-own-Power-Query-Editor-using-Notepad/ba-p/1... 

Bear in mind that if you like dark mode, you should set your custom setup to be compatible with this else it looks pretty messed up.

 

Cheers

 

Manfred

Stachu
Community Champion
Community Champion

I don't know of any M formatter as such, but in the PowerBI preview features there is M intellisense

https://powerbi.microsoft.com/en-us/blog/power-bi-desktop-september-2018-feature-summary/

which makes the code much more readable

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.