Microsoft Power BI ACTION
Execute DAX Query
Execute a DAX (Data Analysis Expressions) query against a Power BI dataset (semantic model). This is the primary analytics tool — use it to answer questions about values, aggregates, or filtered rows in a dataset. Use List Datasets first to resolve a dataset name →
datasetId. The query must be a single valid DAX expression starting with EVALUATE. Table discovery (standard datasets): For datasets published from Power BI Desktop, the REST GET /datasets/{id}/tables endpoint is scoped to push datasets only and will not list tables. Use EVALUATE INFO.TABLES() instead — it returns every table name in the semantic model. Typical agent flow: List Workspaces → List Datasets → Execute DAX Query (EVALUATE INFO.TABLES()) → Execute DAX Query (EVALUATE 'TableName'). Common patterns: • Discover all tables — EVALUATE INFO.TABLES() (use this before querying an unknown dataset) • List all rows of a table — EVALUATE 'Species' • Filter — EVALUATE FILTER('Species', 'Species'[dietType] = "Carnivore") • Top N by column — EVALUATE TOPN(5, 'Species', 'Species'[weightKg], DESC) • Aggregate single value — EVALUATE ROW("Total", SUMX('Species', 'Species'[weightKg])) • Peek at a table's columns — EVALUATE TOPN(0, 'Species') (returns an empty rowset with column names in the response). Limits: max 100,000 rows or 1,000,000 values per query, and DEFINE/multiple-statement queries are not supported via REST. The tenant must have 'Dataset Execute Queries REST API' enabled (admin setting) or the call returns 401/403. Pass workspaceId (from List Workspaces) or workspaceName to target a specific workspace, or omit both for My workspace. See the documentation- Action
- Read only
- OAuth
- SDK
- MCP
IMPLEMENTATION
Call this tool
Connect a user's Microsoft Power BI account once, then configure and run Execute DAX Query from your backend or agent.
import { PipedreamClient } from "@pipedream/sdk"
const pd = new PipedreamClient({
projectId: process.env.PIPEDREAM_PROJECT_ID!,
clientId: process.env.PIPEDREAM_CLIENT_ID!,
clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
projectEnvironment: "production",
})
const result = await pd.actions.run({
id: "microsoft_power_bi-execute-dax-query",
externalUserId: "{external_user_id}", // any stable ID for this user in your system
configuredProps: {
microsoft_power_bi: { authProvisionId: "apn_xxxxxxx" },
datasetId: "Dataset ID",
query: "DAX Query",
},
})
console.log(result)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "microsoft_power_bi-execute-dax-query",
"configured_props": {
"microsoft_power_bi": { "authProvisionId": "apn_xxxxxxx" },
"datasetId": "Dataset ID",
"query": "DAX Query"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "microsoft_power_bi",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "microsoft_power_bi-execute-dax-query",
arguments: {
datasetId: "Dataset ID",
query: "DAX Query",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| Property | Type | Description |
|---|---|---|
datasetId Dataset ID | string | ID of the dataset to query. Use List Datasets to find IDs by name. Required |
query DAX Query | string | A single DAX expression. Must start with EVALUATE. Example: EVALUATE FILTER('Species', 'Species'[dietType] = "Carnivore"). Required |
workspaceId Workspace ID | string | ID of the workspace. Use the List Workspaces tool to see accessible workspaces. Omit to target My workspace. Optional |
workspaceName Workspace Name | string | Name of the workspace (alternative to Workspace ID). Use the List Workspaces tool to see accessible workspaces. Optional |
includeNulls Include Nulls | boolean | If true (default), null values are included in the response. Set to false for compacter output when nulls are not meaningful. Optional |
impersonatedUserName Impersonated User Name | string | UPN of an effective identity to use for Row-Level Security (RLS). Typically only needed for datasets with RLS roles configured. Example: someuser@mycompany.com Optional |
REFERENCE
Tool details
Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.
- Registry key
- microsoft_power_bi-execute-dax-query
- Version
- 0.0.4
- App
- Microsoft Power BI
- Authentication
- OAuth
- Read-only
- Yes
- Destructive
- No
- Open world
- Yes
- Source
- View on GitHub ↗