Format your Code

Here is a measure from a client’s Power BI file (with some of the names changed to protect the innocent). I went to and pasted it in.

Then I pressed the big red button “Format”. This is what I got back.

There are so many advantages to code that looks like this that I can’t begin to list them. The most surprising advantage: looking at formatted code teaches you a lot about how to write DAX.