query_dataset
Execute DAX queries to retrieve data, perform calculations, and filter results from PowerBI datasets.
Instructions
Execute DAX (Data Analysis Expressions) queries against a PowerBI dataset.
This tool allows you to query dataset tables using DAX, PowerBI's formula language. DAX queries can retrieve data, perform calculations, and apply filters.
Use this when you need to:
Retrieve data from dataset tables
Perform calculations and aggregations
Filter and analyze dataset data
Get specific rows or aggregated results
DAX Query Syntax:
Basic table query: EVALUATE TableName
Filtered query: EVALUATE FILTER(TableName, TableName[Column] = "Value")
Aggregation: EVALUATE SUMMARIZE(TableName, TableName[Column], "Total", SUM(TableName[Amount]))
Top N: EVALUATE TOPN(10, TableName, TableName[Column], DESC)
Parameters:
dataset_id (required): The unique identifier of the dataset to query
dax_query (required): DAX query to execute (must start with EVALUATE)
workspace_id (optional): Workspace (group) ID. Omit for "My workspace"
format: Response format - "json" or "markdown" (default: "markdown")
Returns: Query results as a table with rows and columns. Markdown format presents results as formatted tables. Results are limited to 100 rows in markdown view.
Example queries:
Get all rows: "EVALUATE 'Sales'"
Filter data: "EVALUATE FILTER('Sales', 'Sales'[Year] = 2024)"
Aggregate: "EVALUATE SUMMARIZE('Sales', 'Sales'[Category], "Total", SUM('Sales'[Amount]))"
Top 10: "EVALUATE TOPN(10, 'Sales', 'Sales'[Amount], DESC)"
Error handling:
For syntax errors, check your DAX query starts with EVALUATE
If table/column not found, use get_dataset to see available schema
For large result sets, add filters or use TOPN to limit rows
Timeout errors suggest simplifying the query or adding filters
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dataset_id | Yes | ||
| dax_query | Yes | ||
| workspace_id | No | ||
| format | No | markdown |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |