Forum Discussion
Understanding how to format DAX code for readability
- 5 years ago
Hi Anonymous ,
at daxformatter.com you have the possibility to use your own settings (see figure):
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
FrankAT - Great catch there- that's why I love seeking inputs from professionals like you'll.
However, if by default- the DAX formatter showed a long line for this code- should I assume that as a standard best practice? (I know it's personal choice and that's why so many options in settings too)
I would like to know if the way SQLBI formatted had anything to do with the formatting rules SQLBI has on their site as I mentioned:
"Write a function inline only if it has a single argument that is not a function call"
And then this contrasting statement (I thought, not sure)
"Always put arguments on a new line if the function call has 2 or more arguments"
Hi Anonymous ,
If no one asks you which format you must use explicitly , you can write DAX according to personal habits, but the formula is best to have indentation, so that it is more readable.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.