Data Analysis Expressions (DAX) is a formula language introduced by Microsoft in Power Pivot and Analysis Services Tabular to define calculations and queries.

DAX Formatter is a free tool by SQLBI that transform your raw DAX formulas into clean, beautiful and readable code.
The syntax rules used improves the readability of the expressions, if you want learn more read the article Rules for DAX Code Formatting »


You can format any DAX query and expression in the form:
  • Table[column] = …
  • Table[measure] := …
  • [measure] := …
  • [measure] = …
  • measure := …
  • measure = …
  • = …


You can call the service via standard HTTP GET and POST requests. Learn more »


DAX Formatter is not working as expected?
Please fill out the form as completely as possible.

Note: the current formula will be automatically attached to the request.

Black Friday 2015 - 50% OFF on Power Pivot Video Courses

Support Us

If you use DAX Formatter for your posts, please embed our badge:

DAX Formatter by SQLBI DAX Formatter by SQLBI
<a href=""><img src="" alt="DAX Formatter by SQLBI"></a>
<a href=""><img src="" alt="DAX Formatter by SQLBI"></a>

Latest Changes

November 8, 2015:

Added support for ASC/DESC in TOPN function

The TOPN function now accepts ASC/DESC for sort direction parameter (it was 0/1 or FALSE/TRUE in past versions of DAX, Power BI Desktop introduced the new syntax).

October 12, 2015:

Support for TOPN with two arguments

TOPN can be called with only two arguments in Excel 2016, Power BI Desktop, and SSAS 2016. DAX Formatter now supports this syntax.

August 19, 2015:

Fixed comma separator replacement in measure name

If a comma separator was used in measure name requesting a forma with UK/EU settings, the comma was replaced by a dot in the formatted code. Now the original measure name in a measure definition is kept as-is in the formatted code.

August 17, 2015:

Support for new DAX functions in Excel 2016 and Power BI Desktop

Complete support of new DAX syntax in Excel 2016 and Power BI Desktop.

August 13, 2015:

Fixed RANKX and TOPN arguments

A few arguments in RANKX and TOPN were considered optional, whereas they are mandatory, accepting a syntax that was not valid in DAX.

August 10, 2015:

Support for Power BI measure assignment syntax

The assignment can be made by using ‘=’ instead of ‘:=’, as implemented in Power BI Desktop.

July 19, 2015:

Fixed formatting for ISONORAFTER function

The order claus was not preceeded by a comma in the formatted code.



May 24, 2015:

Changed format for VAR and ORDER BY

In case of VAR, the expression after assignment goes in a new line and it is indented, unless it is very simple and short.
In ORDER BY list, a single column is inline, two or more columns are indented and there is one column of ORDER BY per row in the query.

April 9, 2015:

Fixed bug in TOPN syntax

Certain optional arguments of TOPN were considered mandatory, not they can be omitted.

March 20, 2015:

Implemented Description, Visible, and DisplayFolder calculation properties for DAX Editor

The new features implemented in DAX Editor (calculation properties Visible, Description, and DisplayFolder) are supported in DAX Formatter syntax. The extension of custom MDX Script is not yet supported.

February 6, 2015:

Fixed separators bug in HTML version

Choosing non-US separators in HTML-only version was not working and the behavior is now fixed.

January 18, 2015:

Improved detection of table names

Table names having function names where not detected by DAX Formatter unless included within single quotes. Now the behavior has improved and function names can be used in DAX Formatter as table names even without single quotes.

January 11, 2015:

Added raw HTML version

Added a raw HTML version of DAX Formatter. Certain corporate policies do not allow using the scripts we use for a better user experience. You can use the HTML-only version at this address:
Also fixed minor bugs in URL syntax (there was an error using single quotes in DAX syntax).

December 30, 2014:

Fixed missing space at the end of USERELATIONSHIP

There was a missing space before the close parenthesis of USERELATIONSHIP function when it was inline.