Skip to main content
Glama
gurvinder-dhillon

PowerBI MCP Server

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:

  1. Get all rows: "EVALUATE 'Sales'"

  2. Filter data: "EVALUATE FILTER('Sales', 'Sales'[Year] = 2024)"

  3. Aggregate: "EVALUATE SUMMARIZE('Sales', 'Sales'[Category], "Total", SUM('Sales'[Amount]))"

  4. 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

TableJSON Schema
NameRequiredDescriptionDefault
dataset_idYes
dax_queryYes
workspace_idNo
formatNomarkdown

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavior. It mentions the 100-row limit in markdown, error handling, and return format. However, it does not explicitly confirm that queries are read-only, though examples suggest so.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (description, usage, syntax, parameters, returns, examples, error handling). It is front-loaded with the main purpose and every sentence adds value without being verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of DAX queries, the description covers all necessary aspects: purpose, parameters, return format, row limits, error handling, and references to get_dataset. It is comprehensive for an agent to invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description provides clear meanings for all parameters, including workspace_id (omit for My workspace), format options, and DAX query syntax requirements. Examples further clarify usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Execute DAX queries against a PowerBI dataset' with a specific verb and resource. It distinguishes itself from siblings like get_dataset by focusing on querying data rather than metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly lists when to use the tool (retrieve data, perform calculations, filter, etc.) and provides error handling advice, including referring to get_dataset for schema. This serves as an implicit alternative.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gurvinder-dhillon/powerbi-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server