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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors