Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi Group,
we developed a formatter for M/PowerQuery a couple of weeks ago. You find it here:
https://powerqueryformatter.com
You can format M-code online or use our API - as we use the API for our (german) blog https://durchblick-durch-daten.de (formerly https://powerpivotinsights.de).
Please give it a try - and if you have any suggestions or if you find any problems, do not hesitate to send a bug report (link is on the website).
Thanks,
Holger
Very nice, I did something simple but it worked great! Turned this:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dc3BCQAhDETRXnIWSWLGaC1i/21sFPawkJ3rY/hrkVAhqfwd7bIIIWopWVBPpZ1TKvob6keUU+OK+3NXQxvgyYC+ZremMgQT1hzeZ9h+AA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [z = _t, #"GAMMA (Excel)" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"z", type number}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"GAMMA (Excel)"})
in
#"Removed Columns"
Into:
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText(
"dc3BCQAhDETRXnIWSWLGaC1i/21sFPawkJ3rY/hrkVAhqfwd7bIIIWopWVBPpZ1TKvob6keUU+OK+3NXQxvgyYC+ZremMgQT1hzeZ9h+AA==",
BinaryEncoding.Base64
),
Compression.Deflate
)
),
let
_t = ((type text) meta [Serialized.Text = true])
in
type table[z = _t, #"GAMMA (Excel)" = _t]
),
#"Changed Type" = Table.TransformColumnTypes(Source, {{"z", type number}}),
#"Removed Columns" = Table.RemoveColumns(#"Changed Type", {"GAMMA (Excel)"})
in
#"Removed Columns"
Much more readable and it had colors as well but those didn't paste over! Not your fault! 🙂
Hi Greg,
what do you mean with "colors didn't paste over"? If you cut/paste it to something like "word", this is working. If you copy"html" you can use it on your webstie (with colors). Ok, using the powerquery - we do not have a change because this is text only 🙂
Holger
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
14 | |
13 | |
9 | |
7 | |
6 |