From 37f50b2b35ce349c50a7ab4be8f25acb22fb8f20 Mon Sep 17 00:00:00 2001 From: Hodayah Zargari Date: Sun, 11 Oct 2026 11:58:49 +0300 Subject: [PATCH 1/4] DAX plugin new doc --- .../kusto/query/dax-request-plugin.md | 132 ++++++++++++++++++ data-explorer/kusto/query/toc.yml | 2 + 2 files changed, 134 insertions(+) create mode 100644 data-explorer/kusto/query/dax-request-plugin.md diff --git a/data-explorer/kusto/query/dax-request-plugin.md b/data-explorer/kusto/query/dax-request-plugin.md new file mode 100644 index 0000000000..63a402ffa8 --- /dev/null +++ b/data-explorer/kusto/query/dax-request-plugin.md @@ -0,0 +1,132 @@ +--- +title: dax_request plugin +description: Learn how to use the dax_request plugin to send a DAX query to a DAX server network endpoint. +ms.reviewer: gabil +ms.topic: reference +ms.date: 10/11/2026 +monikerRange: "microsoft-fabric || azure-data-explorer" +--- + +# dax_request plugin + +The `dax_request` plugin runs a Data Analysis Expressions (DAX) query against a Power BI semantic model and returns the results as a table. Process the returned table with standard Kusto Query Language (KQL) operators. Invoke the plugin with the [evaluate operator](evaluate-operator.md). + +The plugin uses the Power BI [Execute DAX Queries API](https://learn.microsoft.com/power-bi/developer/execute-dax-queries-arrow/overview), which returns results in Apache Arrow format. The plugin preserves supported column types when it converts the response to a KQL table. + +## Prerequisites + +* The semantic model must be in a workspace assigned to a Fabric or Power BI Premium capacity. +* The **Dataset Execute Queries REST API**, **Allow XMLA endpoints and Analyze in Excel with on-premises semantic models** tenant settings must be enabled. +* You must have [Build permission](https://learn.microsoft.com/power-bi/connect-data/service-datasets-permissions) on the semantic model. +* The cluster callout policy must allow `dax` callouts to `api.powerbi.com`. To change this policy, you need `AllDatabasesAdmin` or `Ops` permissions. + +## Syntax + +`evaluate` ``dax_request`` `(`*ConnectionString*`,`*DaxQuery*`)` [`:` *OutputSchema*] + +Learn more about syntax conventions in the [Syntax conventions for reference documentation](syntax-conventions.md). + +## Parameters + +| Name | Type | Required| Description | +|---|---|---|---| +| ConnectionString | `string` | Yes | The semantic model URL followed by `;Impersonate`. For the supported URL formats, see [Connection string](#connection-string). | +| DaxQuery | `string` | Yes | The DAX query to execute against the semantic model. | +| OutputSchema | `string` | - | The names and types of the expected output columns. Use the syntax `(`*ColumnName*`:`*ColumnType* [`,` ...]`)`. | + +> ![NOTE] +> Specifying *OutputSchema* is recommended because it enables scenarios such as distributed queries and allows query optimizations. The plugin returns an error if the runtime schema doesn't match *OutputSchema*. + +## Connection string + +The connection string consists of the semantic model URL and the `;Impersonate` authentication directive. Use one of the following formats: + +* Semantic model in a workspace: + `https://api.powerbi.com/v1.0/myorg/groups/`*WorkspaceId*`/datasets/`*SemanticModelId*`;Impersonate` + +* Semantic model in My workspace: + `https://api.powerbi.com/v1.0/myorg/datasets/`*SemanticModelId*`;Impersonate` + +The `myorg` path segment is literal. `*WorkspaceId*` and `*SemanticModelId*` must be globally unique identifiers (GUIDs). Don't include a query string, fragment, or trailing path after *SemanticModelId*. + +## Authentication and authorization + +The plugin uses Microsoft Entra on-behalf-of authentication. The engine obtains a token for the requesting user and sends the DAX query in that user's security context. The user must have Build permission on the semantic model. Any row-level security or object-level security configured for the user applies to the query. + +Use `;Impersonate` as the authentication directive. Managed identity, service principal, and application key authentication aren't supported. + +> [!IMPORTANT] +> Use an [obfuscated string literal](scalar-data-types/string.md) for any string that contains confidential information. Obfuscated values don't appear in Kusto tracing. + +## Configure and callout policy + +The plugin makes an external call to Power BI. Because the default callout policy blocks `dax` callouts, a cluster administrator must explicitly allow the Power BI endpoint. + +The following command merges a restrictive `dax` rule into the existing [cluster callout policy](../management/callout-policy.md): + +```kusto +.alter-merge cluster policy callout @'[{ + "CalloutType": "dax", + "CalloutUriRegex": "api\\.powerbi\\.com.*", + "CanCall": true +}]' +``` + +Verify the policy: + +```kusto +.show cluster policy callout +``` + +## Returns + +The plugin returns the DAX query result as a KQL table. It preserves supported Arrow data types. For example, Arrow `int64`, `double`, `utf8`, and `date-time` values map to Kusto `long`, `real`, `string`, and `datetime`, respectively. + +Power BI returns bracketed column names, such as `[Category]`. In KQL, reference these names with the `['...']` syntax, such as `['[Category]']`. + +## Examples + +### Return all rows from a table + +The following example returns all rows from the `Sales` table: + +```kusto +evaluate dax_request( + 'https://api.powerbi.com/v1.0/myorg/groups//datasets/;Impersonate', + 'EVALUATE Sales') +``` + +### Process DAX results with Kusto + +The following example selects two columns in DAX, summarizes the result in KQL, and filters by category: + +```kusto +evaluate dax_request( + 'https://api.powerbi.com/v1.0/myorg/groups//datasets/;Impersonate', + 'EVALUATE SELECTCOLUMNS(Sales, "Category", Sales[Category], "Amount", Sales[Amount])') +| summarize TotalAmount = sum(['[Amount]']) by ['[Category]'] +| where ['[Category]'] == 'Electronics' +``` + +> [!TIP] +> Filter and aggregate data in DAX when possible to reduce the amount of data returned to Kusto. + +### Specify an output schema + +The following example declares an output schema to use the distributed execution path. The declared schema must match the live result schema. + +```kusto +evaluate dax_request( + 'https://api.powerbi.com/v1.0/myorg/groups//datasets/;Impersonate', + 'EVALUATE ROW("cnt", COUNTROWS(Sales), "sumAmt", SUM(Sales[Amount]))') + : (['[cnt]']:long, ['[sumAmt]']:real) +``` + +## Troubleshooting + +| Error | Cause and resolution | +|---|---| +| Invalid connection string | Confirm that the URL uses a supported format, the workspace and semantic model IDs are valid GUIDs, and the string ends with `;Impersonate`. | +| Callout isn't permitted | Configure the cluster callout policy to allow `dax` calls to `api.powerbi.com`. | +| Authentication or authorization error | Confirm that the required tenant settings are enabled and that the requesting user has Build permission on the semantic model. | +| HTTP request error | Ensure Power BI service availability, endpoint accessibility, and the semantic model URL. | diff --git a/data-explorer/kusto/query/toc.yml b/data-explorer/kusto/query/toc.yml index cc92acb1c4..6444dce39c 100644 --- a/data-explorer/kusto/query/toc.yml +++ b/data-explorer/kusto/query/toc.yml @@ -1703,6 +1703,8 @@ items: href: azure-digital-twins-query-request-plugin.md - name: cosmosdb_sql_request plugin href: cosmosdb-plugin.md + - name: dax_request plugin + href: dax-request-plugin.md - name: http_request plugin href: http-request-plugin.md - name: http_request_post plugin From ddb03423583a6879033041f61ddf6a6e9b226c95 Mon Sep 17 00:00:00 2001 From: Hodayah Zargari Date: Sun, 11 Oct 2026 12:03:38 +0300 Subject: [PATCH 2/4] relative links --- data-explorer/kusto/query/dax-request-plugin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-explorer/kusto/query/dax-request-plugin.md b/data-explorer/kusto/query/dax-request-plugin.md index 63a402ffa8..bbd40897fa 100644 --- a/data-explorer/kusto/query/dax-request-plugin.md +++ b/data-explorer/kusto/query/dax-request-plugin.md @@ -11,13 +11,13 @@ monikerRange: "microsoft-fabric || azure-data-explorer" The `dax_request` plugin runs a Data Analysis Expressions (DAX) query against a Power BI semantic model and returns the results as a table. Process the returned table with standard Kusto Query Language (KQL) operators. Invoke the plugin with the [evaluate operator](evaluate-operator.md). -The plugin uses the Power BI [Execute DAX Queries API](https://learn.microsoft.com/power-bi/developer/execute-dax-queries-arrow/overview), which returns results in Apache Arrow format. The plugin preserves supported column types when it converts the response to a KQL table. +The plugin uses the Power BI [Execute DAX Queries API](/power-bi/developer/execute-dax-queries-arrow/overview), which returns results in Apache Arrow format. The plugin preserves supported column types when it converts the response to a KQL table. ## Prerequisites * The semantic model must be in a workspace assigned to a Fabric or Power BI Premium capacity. * The **Dataset Execute Queries REST API**, **Allow XMLA endpoints and Analyze in Excel with on-premises semantic models** tenant settings must be enabled. -* You must have [Build permission](https://learn.microsoft.com/power-bi/connect-data/service-datasets-permissions) on the semantic model. +* You must have [Build permission](/power-bi/connect-data/service-datasets-permissions) on the semantic model. * The cluster callout policy must allow `dax` callouts to `api.powerbi.com`. To change this policy, you need `AllDatabasesAdmin` or `Ops` permissions. ## Syntax From d8cbb61b47c3ffba9b589709b9dc964b7573a7ca Mon Sep 17 00:00:00 2001 From: Hodayah Zargari Date: Wed, 14 Oct 2026 11:46:59 +0300 Subject: [PATCH 3/4] Dax plugin revision - Lea's comments --- .../kusto/query/dax-request-plugin.md | 19 +++++++++++-------- .../kusto/query/evaluate-operator.md | 3 ++- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/data-explorer/kusto/query/dax-request-plugin.md b/data-explorer/kusto/query/dax-request-plugin.md index bbd40897fa..cbeb926040 100644 --- a/data-explorer/kusto/query/dax-request-plugin.md +++ b/data-explorer/kusto/query/dax-request-plugin.md @@ -3,7 +3,7 @@ title: dax_request plugin description: Learn how to use the dax_request plugin to send a DAX query to a DAX server network endpoint. ms.reviewer: gabil ms.topic: reference -ms.date: 10/11/2026 +ms.date: 10/14/2026 monikerRange: "microsoft-fabric || azure-data-explorer" --- @@ -17,8 +17,8 @@ The plugin uses the Power BI [Execute DAX Queries API](/power-bi/developer/execu * The semantic model must be in a workspace assigned to a Fabric or Power BI Premium capacity. * The **Dataset Execute Queries REST API**, **Allow XMLA endpoints and Analyze in Excel with on-premises semantic models** tenant settings must be enabled. -* You must have [Build permission](/power-bi/connect-data/service-datasets-permissions) on the semantic model. -* The cluster callout policy must allow `dax` callouts to `api.powerbi.com`. To change this policy, you need `AllDatabasesAdmin` or `Ops` permissions. +* You must have [Build and Read permissions](/power-bi/connect-data/service-datasets-permissions) on the semantic model. +* The [cluster callout policy](#configure-and-callout-policy) must allow `dax` callouts to `api.powerbi.com`. To change this policy, you need `AllDatabasesAdmin` or `Ops` permissions. ## Syntax @@ -32,10 +32,10 @@ Learn more about syntax conventions in the [Syntax conventions for reference doc |---|---|---|---| | ConnectionString | `string` | Yes | The semantic model URL followed by `;Impersonate`. For the supported URL formats, see [Connection string](#connection-string). | | DaxQuery | `string` | Yes | The DAX query to execute against the semantic model. | -| OutputSchema | `string` | - | The names and types of the expected output columns. Use the syntax `(`*ColumnName*`:`*ColumnType* [`,` ...]`)`. | +| OutputSchema | - | - | The names and types of the expected output columns. Use the syntax `(`*ColumnName*`:`*ColumnType* [`,` ...]`)`. | > ![NOTE] -> Specifying *OutputSchema* is recommended because it enables scenarios such as distributed queries and allows query optimizations. The plugin returns an error if the runtime schema doesn't match *OutputSchema*. +> Specifying *OutputSchema* is recommended. It lets Kusto determine the plugin’s output columns and types without sending the DAX query to Power BI during schema discovery. The Power BI request is instead deferred to query execution, alongside the rest of the KQL query. The plugin returns an error if the returned schema is incompatible with the declared schema. ## Connection string @@ -51,7 +51,7 @@ The `myorg` path segment is literal. `*WorkspaceId*` and `*SemanticModelId*` mus ## Authentication and authorization -The plugin uses Microsoft Entra on-behalf-of authentication. The engine obtains a token for the requesting user and sends the DAX query in that user's security context. The user must have Build permission on the semantic model. Any row-level security or object-level security configured for the user applies to the query. +The plugin uses Microsoft Entra on-behalf-of authentication. The engine obtains a token for the requesting user and sends the DAX query in that user's security context. The user must have [Build and Read permissions](/power-bi/connect-data/service-datasets-permissions) on the semantic model. Any row-level security or object-level security configured for the user applies to the query. Use `;Impersonate` as the authentication directive. Managed identity, service principal, and application key authentication aren't supported. @@ -84,11 +84,14 @@ The plugin returns the DAX query result as a KQL table. It preserves supported A Power BI returns bracketed column names, such as `[Category]`. In KQL, reference these names with the `['...']` syntax, such as `['[Category]']`. +> [!WARNING] +> The plugin uses the default row limit of the [Power BI Execute DAX Queries API](/rest/api/power-bi/datasets/execute-dax-queries#request-body) (`resultSetRowCountLimit`). If the DAX query produces more rows than this limit the returned table can be incomplete without an error. Filter or aggregate data in the DAX query to keep the result within the limit. Filtering or aggregating afterward in KQL does not recover omitted rows. + ## Examples ### Return all rows from a table -The following example returns all rows from the `Sales` table: +The following example queries the `Sales` table. The returned result is subject to the API’s default row limit. ```kusto evaluate dax_request( @@ -113,7 +116,7 @@ evaluate dax_request( ### Specify an output schema -The following example declares an output schema to use the distributed execution path. The declared schema must match the live result schema. +The following example declares the expected output schema so that Kusto can determine the schema without contacting Power BI during query analysis. The declared schema must match the live result schema. ```kusto evaluate dax_request( diff --git a/data-explorer/kusto/query/evaluate-operator.md b/data-explorer/kusto/query/evaluate-operator.md index 5257530201..21859ddf95 100644 --- a/data-explorer/kusto/query/evaluate-operator.md +++ b/data-explorer/kusto/query/evaluate-operator.md @@ -3,7 +3,7 @@ title: evaluate plugin operator description: Learn how to use the evaluate plugin operator to invoke plugins. ms.reviewer: alexans ms.topic: reference -ms.date: 08/11/2024 +ms.date: 10/14/2026 --- # evaluate plugin operator @@ -53,6 +53,7 @@ The following plugins are supported: * [bag-unpack plugin](bag-unpack-plugin.md) * [basket plugin](basket-plugin.md) * [cosmosdb-sql-request plugin](cosmosdb-plugin.md) +* [dax_request plugin](dax-request-plugin.md) * [dcount-intersect plugin](dcount-intersect-plugin.md) * [diffpatterns plugin](diffpatterns-plugin.md) * [diffpatterns-text plugin](diffpatterns-text-plugin.md) From 0126b9a3a6bee55013788c3a731b789eb1d0dd7f Mon Sep 17 00:00:00 2001 From: Hodayah Zargari Date: Sun, 18 Oct 2026 09:56:54 +0300 Subject: [PATCH 4/4] build and read --- data-explorer/kusto/query/dax-request-plugin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data-explorer/kusto/query/dax-request-plugin.md b/data-explorer/kusto/query/dax-request-plugin.md index cbeb926040..9d046312a5 100644 --- a/data-explorer/kusto/query/dax-request-plugin.md +++ b/data-explorer/kusto/query/dax-request-plugin.md @@ -3,7 +3,7 @@ title: dax_request plugin description: Learn how to use the dax_request plugin to send a DAX query to a DAX server network endpoint. ms.reviewer: gabil ms.topic: reference -ms.date: 10/14/2026 +ms.date: 10/18/2026 monikerRange: "microsoft-fabric || azure-data-explorer" --- @@ -131,5 +131,5 @@ evaluate dax_request( |---|---| | Invalid connection string | Confirm that the URL uses a supported format, the workspace and semantic model IDs are valid GUIDs, and the string ends with `;Impersonate`. | | Callout isn't permitted | Configure the cluster callout policy to allow `dax` calls to `api.powerbi.com`. | -| Authentication or authorization error | Confirm that the required tenant settings are enabled and that the requesting user has Build permission on the semantic model. | +| Authentication or authorization error | Confirm that the required tenant settings are enabled and that the requesting user has Build and Read permission on the semantic model. | | HTTP request error | Ensure Power BI service availability, endpoint accessibility, and the semantic model URL. |