assert_measure
Evaluate a scalar DAX expression and compare it to an expected value, returning pass or fail. Supports numeric tolerance and ordinal string comparison for validating Power BI measures.
Instructions
Evaluate a scalar DAX expression (EVALUATE ROW) and compare the result to an expected value: numeric-vs-numeric within tolerance, otherwise ordinal string compare of the invariant-culture rendering. A mismatch returns pass:false (not an error) - the single-assert form of run_golden_set.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dax | Yes | scalar DAX expression, e.g. [Total Sales] or CALCULATE([Sales], Dim[Year]=2025) | |
| expected | Yes | expected value, invariant-culture (e.g. 12345.67) | |
| sessionId | Yes | ||
| tolerance | No | absolute numeric tolerance (default 1e-6) |