DAX Formatter

Paste a DAX measure or expression, click Format. Everything runs in your browser and nothing is uploaded.

Input

Formatted DAX

Why format your DAX?

DAX measures written directly in the Power BI formula bar often end up as one dense line. Consistent formatting, with keywords in a predictable case, table references written the same way every time, and each VAR on its own line, makes measures far easier to read, review and debug.

This formatter is a from-scratch implementation of SQLBI's published formatting rules, not a copy of their engine. Your DAX is processed locally in your browser and is never sent to a server.

How to use this formatter

  1. Copy a measure or expression from the Power BI formula bar, or from DAX Studio.
  2. Paste it into the Input box on the left.
  3. Pick Short lines to keep expressions compact where they fit, or Long lines to always break every function argument onto its own line.
  4. Click Format.
  5. Copy the result and paste it back into Power BI.

Frequently asked questions

Is my DAX uploaded anywhere?

No. Everything runs locally in your browser using JavaScript. Your measures never leave your device or touch a server.

What formatting rules does it follow?

Recognized DAX function names and keywords (IF, CALCULATE, VAR, RETURN and so on) are uppercased. Table and column references like Sales[Amount] get no space before the bracket. Your own measure, variable, table and column names are left exactly as you typed them. Each VAR gets its own line, and RETURN starts its own line.

Does it check that my DAX is correct?

It checks structure only: balanced parentheses and brackets, and properly closed strings and comments. It does not know Power BI's full DAX grammar, so it can't catch every semantic mistake, like calling a function with the wrong arguments. If your DAX has a structural problem, the formatter shows an error at the line and column where it lost track.

What's the difference between Short lines and Long lines?

Short lines keeps a function call on one line whenever it reasonably fits, only breaking nested calls when needed. Long lines always puts every function argument on its own line, which is useful for reviewing deeply nested measures.

Does this match daxformatter.com exactly?

Not necessarily. This tool re-implements SQLBI's published rules independently rather than calling their engine, so line-wrapping decisions in particular may differ in edge cases, especially for very long or unusually structured expressions.

Can I format Power Query M code here?

No. DAX and Power Query M are different languages. Use the Power Query M Formatter for M code instead.

Formats DAX using SQLBI's published formatting rules. Not affiliated with or endorsed by SQLBI.