Power BI tools

DAX formatter.

Format DAX fast. Use AI only when you need an explanation.

Input

Paste DAX, then choose an action.

Loading editor...

Monaco editor is enabled with SQL-syntax fallback and auto-indent. Format executes locally.

81 / 50,000 chars

§

What is DAX?

DAX (Data Analysis Expressions) is the formula and query language for Power BI, Analysis Services Tabular models, and Excel Power Pivot. It enables dynamic aggregations, time intelligence, and row-level security in data models.

Essential DAX Functions

CALCULATE

The most important DAX function. Modifies filter context before evaluating an expression.

CALCULATE(
  [Total Sales],
  Product[Color] = "Red"
)
VAR / RETURN

Declare variables for readability and performance. Variables are evaluated once and can be reused.

VAR TotalQty = SUM(Sales[Quantity])
VAR AvgPrice = AVERAGE(Sales[Price])
RETURN
  TotalQty * AvgPrice
FILTER + Iterator

FILTER returns a table. SUMX, AVERAGEX iterate row-by-row over that table.

SUMX(
  FILTER(
    Sales,
    Sales[Amount] > 1000
  ),
  Sales[Amount]
)

How to Format DAX

  1. 1

    Paste DAX code

    Copy your DAX measure or query and paste it into the Monaco editor. The editor supports syntax highlighting and auto-indent.

  2. 2

    Format locally

    Click Format to restructure your DAX with consistent indentation, line breaks after each argument, and aligned parentheses.

  3. 3

    Explain with AI

    Click AI Explain for a step-by-step plain-English breakdown of what your DAX formula does, including filter context and evaluation order.

  4. 4

    Share or copy

    Copy the formatted output to clipboard, or generate a shareable URL that preserves your code for teammates.

DAX Formatting Best Practices

  • One argument per line — makes it easy to spot missing commas and nested functions
  • Indent nested functions — each level of nesting gets one indent level
  • Use VAR for repeated expressions — improves both readability and query performance
  • Align closing parentheses — closing parens should align with the function that opened them

FAQ

What is DAX and why does formatting matter?

DAX (Data Analysis Expressions) is the formula language used in Power BI, Analysis Services, and Excel Power Pivot. Well-formatted DAX is easier to read, debug, and maintain — especially for complex measures with nested CALCULATE, FILTER, and VAR/RETURN patterns.

What DAX patterns does the formatter handle?

The formatter handles CALCULATE with filter arguments, nested FILTER/SUMX/ADDCOLUMNS iterators, VAR/RETURN variable declarations, SWITCH/TRUE conditional logic, and deeply nested expressions. It preserves string and number literals while restructuring the surrounding syntax.

Does the formatter change my DAX logic?

No. The formatter only adjusts whitespace, indentation, and line breaks. It does not rename columns, reorder arguments, or modify any business logic. String literals and numeric constants are preserved exactly as written.

How do I share a formatted DAX snippet?

After formatting, click Share URL to generate a link that encodes your DAX code in the URL parameters. Anyone with the link sees your formatted code. No data is stored on the server.

More tools