Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello dear queriers,
Since I began working with Power Query and PBI, I have been looking for an easy way to export what is happening in all the queries and steps they contain, in a format that would be easily readable by anyone needing to use or edit it. I would then be able to create a full documentation.
I tried copying the code from the advanced editor into a Word document, but formatting disappears.
Is there any way to export a documentation from Power Query?
Thanks in advance for any help.
Solved! Go to Solution.
AFAIK, there is no official format of PQ snippet, after all, the M is so far not as widely used as sql or html. But some guru has develop this formatter worth trying:
Power Query Formatter | Beautify your Power Query code
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Replying to an old thread.
There is (now?) a workaround for this - if you copy the M code from the desktop file & paste it into a query on the Power BI Service, the formatting will be re-created, and maintained if you then copy & paste it back into e.g. Word (maybe something to do with HTML rendering or something?)
To copy out the text of all your queries:
Just in case you weren't aware, you can select all of your queries at the same time and copy and paste them into a text editor (or another Power Query editor) all at once.
OMG, I can't believe I never tried this. You just saved me so many clicks. Thanks loads!
AFAIK, there is no official format of PQ snippet, after all, the M is so far not as widely used as sql or html. But some guru has develop this formatter worth trying:
Power Query Formatter | Beautify your Power Query code
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Excellent tool, thanks for the link. Here is how I will work with this:
Thank you so much!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
10 | |
7 | |
6 | |
6 | |
6 |