Semantic Model (XMLA)

This connector is used to query Microsoft Fabric Semantic Models (Power BI datasets) using the XMLA endpoint REST API with DAX queries.

Connection configuration

NameMandatoryDefaultDescription
modenooauthAuthentication mode: oauth
datasetidyesPower BI dataset ID
tokennoAccess token (for token mode)
tenantidnoAzure AD tenant ID (for spn mode)
clientidnoAzure AD application client ID (for spn mode)
clientsecretnoAzure AD application client secret (for spn mode)

Authentication modes

ModeDescription
oauthOpens a browser login page for interactive authentication

Connection example

connections:
  mysemanticmodel:
    type: semantic_model
    mode: oauth
    dataset_id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Test case configuration

NameMandatoryDefaultDescription
queryyesDAX query to execute
bodynoCustom request body (overrides default)

Test case example

Test semantic model measure:
  source:
    type: semantic_model
    connection: mysemanticmodel
    query: |
      EVALUATE
      SUMMARIZECOLUMNS(
        DimDate[Year],
        "Revenue", [Total Revenue]
      )
  expected:
    type: csv
    path: ./expected/revenuebyyear.csv

How it works

The connector sends a POST request to the Power BI REST API:

POST https://api.powerbi.com/v1.0/myorg/datasets/{dataset_id}/executeQueries

The DAX query is wrapped in a JSON body with includeNulls: true and the results are parsed into a DataFrame.

Requirements

  • pip install azure-identity requests
  • Power BI Premium or Fabric capacity (XMLA endpoint must be enabled)
  • Appropriate permissions on the dataset