View as Markdown
Microsoft Power BI icon

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 WorkspacesList DatasetsExecute 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)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Execute DAX Query inputs
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