Power BI icon

Power BI

Work with the Power BI API

Dataset → Execute Queries

AI-generated

Summary

Execute a DAX query on a specified Power BI dataset within a workspace (group), optionally including null values and impersonating a user.

Inputs

  • Group (Workspace) Name or ID — Select the Power BI workspace by its name or ID. Leave blank to use "My Workspace". You can choose from the dynamically loaded list or specify an expression.
  • Dataset Name or ID (required) — Select the target dataset by name or ID within the chosen workspace. This determines where the DAX query will be executed.
  • DAX Query (required) — Enter the DAX query string to execute against the specified dataset.
  • Include Nulls — Choose whether to include null (blank) values within the query results.
  • Impersonated User Name — Optionally provide a user principal name (UPN) to impersonate for this query, effective only if the model has Row-Level Security (RLS) enabled.

Output shape

a single record containing the query results as JSON

The output is the JSON response from the executed DAX query on the dataset. If the impersonated user is specified, the data returned reflects that user's permissions if RLS is enabled. Errors are thrown if execution fails unless 'Continue On Fail' is set.

Examples

Example 1: Execute a DAX query to retrieve all rows from a main table in a dataset within a specific workspace while including blank values.

Set the 'Group (Workspace) Name or ID' to the target workspace, select the 'Dataset Name or ID', enter the DAX query (e.g., 'EVALUATE VALUES(MyMainTable)'), and toggle 'Include Nulls' as needed.

Discussion