PlantOps BI

DAX Lint

Paste one or more measures. The checker reads them as DAX tokens, not raw text, so comments and strings never trip a rule. Format DAX lays them out one argument per line where they run long, changing only whitespace and the case of function names. Nothing leaves the page.

A share link carries your DAX in the part of the URL after #, which browsers never send to a server. Anyone you give the link to can read it.

Findings

    Rules

    The checker has no model metadata, so a rule fires only when the text alone proves the problem. It can't tell whether [Sales] is a measure or a column, and it won't guess.

    Error Unbalanced parentheses unbalanced-parens
    Every opening parenthesis needs a closing one. The measure will not save.
    Error Column used without aggregation naked-column
    A measure has no current row, so a bare column reference outside any function cannot return a value. Wrap it in SUM, MAX, SELECTEDVALUE or an iterator.
    Warning Division with / slash-division
    When the denominator is zero, or blank while the numerator is not, the / operator returns Infinity or NaN, and visuals show it. DIVIDE returns BLANK (or the alternate result you pass), which visuals skip. Division by a non-zero number literal cannot hit zero, so it is not flagged.
    Warning IFERROR or ISERROR iferror
    Error handling can push DAX into slower, cell-by-cell evaluation, and it hides the cause. Test the condition that produces the error instead, or use DIVIDE for division.
    Warning FILTER over a whole table inside CALCULATE filter-whole-table
    FILTER ( Table, ... ) as a CALCULATE argument filters every column of the expanded table, which is slower and can override filters on related tables. Filter the columns you mean: CALCULATE ( [m], Table[col] = "x" ), or FILTER ( ALL ( Table[col] ), ... ).
    Warning SUMX over a single column sumx-single-column
    SUMX ( T, T[col] ) is SUM ( T[col] ) with more to read. Keep the iterator for expressions that combine columns.
    Note Table cleared inside an iterator transition-cleared
    Inside SUMX, ADDCOLUMNS, FILTER and other iterators, CALCULATE first turns the current row into a filter, then applies REMOVEFILTERS, ALL or ALLSELECTED. If the cleared table is a fact related to what you iterate, its expanded table holds that dimension, so the row you are on is cleared too. Other filter arguments are evaluated before the row becomes a filter, so VALUES ( Date[Date] ) there returns the outer period, not the row. Without the model the linter cannot tell whether the tables are related, so this is a note. To keep the row, capture it first: VAR RowDates = CALCULATETABLE ( VALUES ( Date[Date] ) ), then pass RowDates as a filter.
    Note CALCULATE with nothing to change calculate-no-filter
    CALCULATE with only an expression and no filter arguments changes nothing at the top of a measure, because a measure already runs in the filter context of the visual. It does matter inside an iterator, where it turns the row into a filter, and the rule does not fire there.
    Note IF over HASONEVALUE hasonevalue-if
    IF ( HASONEVALUE ( T[c] ), VALUES ( T[c] ), alternate ) is what SELECTEDVALUE ( T[c], alternate ) does, in one call that reads as what it means.
    Note Deeply nested IF nested-if
    Three or more IFs chained through their else branch read better as SWITCH ( TRUE (), condition1, result1, condition2, result2, ..., else ), which also keeps the closing parentheses from piling up.
    Note DIVIDE returns 0 instead of blank divide-zero-alternate
    DIVIDE ( a, b, 0 ) turns every empty cell into a zero. Visuals keep rows whose measure is not blank, so a table by product and month fills with rows of zeros for combinations that never happened, and a zero averages into any AVERAGEX over the measure. Leave the third argument out unless a zero really means zero.
    Note Repeated expression repeated-expression
    The same expression appears more than once in this measure. A VAR evaluates it once and names it, which helps both speed and reading.
    Note TODAY or NOW today-utc
    In the Power BI service these return UTC time, so a report read in the evening in the Americas can already be on tomorrow. Use a date column from the data or a refresh-date table when the boundary matters.

    Every DAX block on this site passes these rules with no errors or warnings. The site's tests check that on every build. All rules, with the Documenter's model rules, are on the rules page.