Downloads

DAX formatter and formula checker

Format a DAX formula into a standard layout and check it for common mistakes, all in your browser.

Privateto your browserwhat you paste is not sent anywhere

Formatted formula


    

Functions in this formula

Format a formula to list its functions. A name links to its reference page when the page exists.

Check my formula

Press Check my formula. Errors are likely to stop the formula working. Warnings are often wrong or slow. Tips are good practice.

How it works

  1. Paste a formula

    Paste a measure or a calculated column.

  2. Format it

    Choose a line width and press Format. Function names link to the reference.

  3. Check it

    Errors, warnings and tips show what to fix before you run it.

How the formatter works

The formatter reads your formula with a small tokenizer before it changes anything, so it knows what is code and what is text. A string such as "VAR RETURN" and a comment such as // note or /* note */ are kept exactly as you wrote them. Table names such as 'Date'[Date] and column references such as Sales[Amount] are treated as single names and are not changed.

Then the formatter lays out the code. VAR and RETURN each start a new line. A function call stays on one line while it fits the line width you pick. When a call is too long, each argument goes on its own line, indented four spaces, and the closing bracket sits under the function name.

The checker reads the same tokens. It looks for an unclosed text string or bracket, a SUM, AVERAGE, MIN or MAX over a calculation (use the X version instead), a measure used inside a true or false filter in CALCULATE, a FILTER over a whole table, IFERROR, EARLIER, a comparison with BLANK() made with an equals sign, a division with the slash character instead of DIVIDE, and a VAR with no RETURN.

What it does not do

Frequently asked questions

Does the formatter change my measure or column names?

No. Measure names, column names, table names and text strings are left as written. Only the capitals of function names and the keywords VAR, RETURN, DEFINE, MEASURE, EVALUATE, IN, NOT, AND, OR, TRUE and FALSE can change, and you can turn that off.

Why does a short function break onto several lines?

It is longer than the line width you chose. Pick a larger width, or choose No limit, to keep each call on one line.

Does the tool send my formula anywhere?

No. The formatter and the checker run in your browser. The page only reads the list of function reference pages from this site, so it can add links.

Why does the checker report a problem in a formula that works?

The checks look at the pattern of the text, not at what the formula means. A warning such as "IFERROR hides real mistakes" is advice, not proof of a bug. Read the message, then decide.

More tools: all tools · function reference · guides