Run Query (DAX)

run_query is how the assistant executes DAX queries and validates results against the connected semantic model. It can also analyze query performance and retrieve VertiPaq statistics.

You usually won’t paste raw tool calls-ask the LLM to run small, aggregated validation queries and summarize results.

What to ask the LLM

“Run a DAX query to validate totals for the last 30 days. Return only aggregated results.” “Return only the top 20 rows for this breakdown.” “Analyze performance for this query and explain what’s slow.” “Get VertiPaq stats and summarize the biggest storage drivers.” “Test access across these roles and summarize differences.”

Practical guidance

Common scenarios

Validate business logic

"Write and run a validation query for measure '[Total Sales]' by month for the last 12 months." "Compare '[Total Sales]' vs '[Net Sales]' and explain differences."

Explain a measure with evidence

"Explain '[Gross Margin %]'. Then run a small query that shows numerator/denominator side-by-side for top 10 products."

Top contributors

"Return top 20 products by '[Total Sales]' for the last 30 days. Only return product name and sales."

Investigate performance

"Analyze this query's performance and propose modeling + DAX optimizations." "Run performance analysis 3 times and summarize consistency. Include query plan and timings if supported."

Understand model storage (VertiPaq)

"Show the largest tables/columns and summarize cardinality/storage issues."

Test security behavior (RLS)

"Test access across roles A/B/C and summarize differences in returned totals."

Role testing and impersonation (important)

Locked-down environments (mode behavior)

ModeAvailability
Full modeAvailableAvailable
Read-only modeAvailableAvailable
Browse-only modeNot availableNot available

Notes: Service-only: some impersonation scenarios; keep outputs small/masked.

Learn more about modes and restrictions.

How to keep queries safe and useful

Prefer aggregates over raw rows

Good:

“Return totals by month.” “Return top 20 products by sales.”

Riskier (often too large):

“EVALUATE ‘Sales’” (full table dumps)

Always control output size

Ask:

“Limit results to top 20 rows.” “Return only 2–3 columns needed for validation.”

Also ask for explicit caps:

“Limit to 1 row/1 column (scalar) for role comparison.” “Hard-cap at 200 rows even if the query returns more.”

Masking and sharing

If you plan to paste results into a ticket/PR/chat:

“Enable masking and keep row limits conservative.”

Troubleshooting

Ask for a smaller query, fewer columns, fewer groups, or a smaller date range. If you need to benchmark performance, ask for the performance analysis mode rather than dumping results.

The environment caps result size. Ask for aggregates, smaller TOPN, or adjust row limits (if allowed).

Query execution is intentionally disabled. Ask the assistant to switch to schema browsing and propose queries you can run elsewhere.

See also