execute_dax
Run DAX queries on Power BI datasets to extract data, with results returned as JSON or saved to CSV files for large outputs.
Instructions
Execute a DAX query against a Power BI dataset and return the result rows.
The query must start with EVALUATE (standard DAX query syntax). Results are returned as a JSON array of objects, with column names as keys.
Small results (<= 50 rows) are returned inline as JSON.
Large results (> 50 rows) are automatically saved to a CSV file and a
compact summary is returned with the file path, column names, row count,
and a preview of the first 5 rows. Use read_query_result to page
through a saved CSV, or read the file directly.
Every successful execution is logged to a local history file for
auditability and cross-session reuse. Use search_query_history to
find prior queries. The query_summary parameter makes history search
much more effective — always provide it when you can.
Limitations imposed by the Power BI API:
Maximum 1,000,000 values or 100,000 rows per query.
Rate limit: 120 requests per minute per user.
Only DAX is supported; MDX and DMV queries are not.
The tenant setting "Dataset Execute Queries REST API" must be enabled.
Tips:
Use TOPN or FILTER to limit large result sets.
Use SUMMARIZECOLUMNS for aggregated queries.
Use CALCULATETABLE for filtered table expressions.
Use max_rows to sample a large table without rewriting the DAX.
Use result_name to give the saved CSV a meaningful filename.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace_id | Yes | ||
| dataset_id | Yes | ||
| dax_query | Yes | ||
| max_rows | No | ||
| result_name | No | ||
| query_summary | No |