Benchmark methodology
Equality is the gate to benchmarking
A fast measure that changes the business answer is not an optimization. Compare the exact outputs first across unfiltered, single-filter, multiple-filter, empty-result and combined date/category cases. The fixture uses Whole Number amounts, no null inputs, a unique Product key and a single-direction relationship. Compare BLANK as distinct from zero.
Define a controlled experiment
Freeze model data and build, query text, relationships, data types, security context, compatibility level, hardware, visual configuration, output shape, and concurrency. Keep both candidate measures in the same model for query-level tests; compare model size and refresh separately when removing the stored column. Record cardinality, actual model bytes if available, and trace availability. Use the exact same query shape in each pair, changing only the measure definition.
Example 1 — filter replacement trap
With Revenue = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice]), the intersection pair in lesson 2 returns 180 without a category filter, 60 for A, 120 for B+C, and BLANK for C. A bare Boolean CALCULATE([Revenue], Product[Category] IN {"A", "B"}) replaces an existing filter on that column and returns 180 even under C. That is a failed equality gate, not a faster candidate. Use parity.dax and the expected-results file to check all cases before timing.
Example 2 — compare repeated samples
For teaching only, two hypothetical warm timing series are A: 20, 22, 23, 24, 80 ms and B: 18, 19, 20, 21, 22 ms. Medians are 23 and 20 ms; ranges are 20–80 and 18–22 ms. The high A observation merits investigation, not silent removal. These invented samples show reporting arithmetic only; they are not Power BI measurements and cannot justify choosing B. Save raw runs and report median, min/max and a percentile with method and sample count; do not infer statistical significance from a tiny sample.
Cold and warm run protocol
Only on an isolated local model with explicit permission: DAX Studio Run Benchmark clears the engine cache before each cold run, and does not clear it for warm runs. This is not a cold OS or source cache guarantee. For each filter case and candidate, predeclare 5 cold and 10 warm measured runs, prime warm runs separately, alternate candidate order across repeated blocks, and keep trace settings constant. If isolation is unavailable, skip cold runs and label warm/unknown cache state. Keep concurrency fixed; no load tests. Record error runs, source latency separately if applicable, and visual rendering in a separate experiment.
Practice and sources
Use the worksheet to prepare the experiment for the aggregation and filter pairs. Record the expected values, reject the incorrect candidate, and leave all timing cells NOT RUN until actual execution. Sources: https://daxstudio.org/docs/features/run-benchmark/ ; https://learn.microsoft.com/en-us/power-bi/guidance/dax-avoid-avoid-filter-as-filter-argument (search extract only; page retrieval failed) ; https://learn.microsoft.com/en-us/dax/keepfilters-function-dax