DAX query statements
A query returns rows, not a measure definition
A DAX query requests a table from a semantic model. A measure computes one scalar in its current evaluation context. EVALUATE is a query keyword, not a function; it needs a table expression. A result can contain one row or millions, so project only required columns and constrain large requests. Use the isolated fixture in labs/dax-queries/README.md. Import QuerySales and QueryCategory, whole-number LineID/Amount, text Category, one-to-many active single-direction relationship from QueryCategory to QuerySales. No other relationships, filters or RLS in this disposable local model. Native execution is pending; outputs below are offline predictions.
Read the query clauses
EVALUATE <table expression> is required; multiple EVALUATE statements can produce separate result sets. ORDER BY <column or expression> [ASC|DESC] sorts the returned rows. Model sort-by metadata is not a substitute. START AT supplies constant starting values aligned to ORDER BY columns; it does not limit row count. SELECTCOLUMNS projects named expressions for each input row. A table constructor uses braces; ROW names scalar result columns.
Example 1 — inspect a reproducible suffix
EVALUATESELECTCOLUMNS('QuerySales', "LineID", 'QuerySales'[LineID], "Amount", 'QuerySales'[Amount])ORDER BY [LineID] ASCSTART AT 3Expected ordered (LineID, Amount): (3,80), (4,20), (5,100), (6,0). IDs 1 and 2 precede the inclusive start value. Remove START AT to inspect all six lines. Do not treat this as stable pagination unless the source snapshot and ordering key are stable.
Example 2 — return scalar diagnostics as tables
EVALUATE ROW("Revenue", SUM('QuerySales'[Amount]), "Lines", COUNTROWS('QuerySales'))EVALUATE { ("Low", 0), ("High", 100) }ORDER BY [Value2] ASCResult 1 has one row: Revenue 350, Lines 6. Result 2 contains (Low,0), (High,100) ordered by Value2; a multi-column constructor names its columns Value1 and Value2. EVALUATE SUM(...) alone is invalid because the expression is scalar. Some clients display multiple result sets differently; execute each statement separately if necessary.
Tool workflow and mistakes
In Desktop open DAX Query View in the disposable file and run the selected query; inspect values and column names. In an approved DAX Studio installation, select the running local model in the connection dialog and run the same read-only query. Verify model identity and engine version; do not connect to a shared or production model. Do not use Update model, export sensitive data, clear caches, or install software without approval. Use explicit ORDER BY even if the grid happens to look sorted. START AT is not TOPN.
Practice and references
Change the start value to 5; predict the two output rows and explain why it does not change the overall revenue measure. Record tool, model and engine build if native execution is available.