A DAX formatter to tidy up your code
Use this handy web based formatter to turn shameful code into neat DAX!

Posted by Sam Lowrie on 30 July 2018

You need a minimum screen resolution of about 700 pixels width to see our blogs. This is because they contain diagrams and tables which would not be viewable easily on a mobile phone or small laptop. Please use a larger tablet, notebook or desktop computer, or change your screen resolution settings.

From crummy code to dignified DAX

I was watching Guy in a Cube (my favourite BI youtuber) with Patrick and in this particular episode they had a guest: Marco Russo. Marco told Patrick off for his messy "code" and said it was not DAX.

Dax

If he thought Patrick's code was bad, what would he say about mine? This is DAX code from my blog on paginating tables.

With my SQL code I always pass it through a formatter such as PoorSQL but I never thought/knew that there was a DAX equivalent.

DAX Power BI Nice code

You can find the website Marco showed Patrick here - it's called Dax Formatter.

Simply copy your shameful code into the top pane of the website:

Dax converter

For shame, for shame!

Click the format button in the bottom right hand corner and wait a few seconds to receive some formatted DAX:

Dax Code

I guess it is a matter of taste....

This blog has 0 threads Add post