Download Reportworq

This is the archived documentation for Reportworq 5. It is kept for reference and is no longer updated.

Go to the Reportworq 6 documentation

Configuring a Microsoft Power BI (ADOMD) Datasource

ReportWORQ can connect to Power BI semantic models (datasets) and Azure / SQL Server Analysis Services tabular models over the XMLA endpoint using the native ADOMD client. In the datasource picker this connection type appears as PowerBI XMLA - ADOMD.

There are two ways to connect ReportWORQ to a Power BI XMLA endpoint:

Both connection types return their results through the same worksheet formula, RW.Relational.Export (previously RWSQL).


Before you begin#


Add the connection#

  1. In Administration → Datasources, add a new datasource and select PowerBI XMLA - ADOMD.
  2. Give the connection a Datasource Name — this is the name you reference from your RW.Relational.Export formulas.
  3. Choose an Authentication Mode and complete the fields (see Authentication).
  4. Enter the Connection String (see Connection string).
  5. Click Test Connection, then Save Changes.

Datasource settings#

SettingValue / Notes
Enable datasource connectionTurns this connection on or off.
Datasource NameThe friendly name referenced from RW.Relational.Export.
Authentication ModeOAuth Authentication (service principal) or Password Authentication (user login).
Connection StringThe XMLA endpoint / server string. Supports the %USERNAME% and %PASSWORD% placeholders.
%USERNAME% VariableValue substituted for %USERNAME% in the connection string. Stored encrypted.
%PASSWORD% VariableValue substituted for %PASSWORD% in the connection string. Stored encrypted.
Validation QueryQuery run by Test Connection. Defaults to SELECT * FROM $SYSTEM.DISCOVER_CATALOGS, a lightweight DMV that works against Power BI XMLA and Analysis Services.
Command Timeout (Advanced Options)Query timeout in seconds. Default 30; range 1–3600.

Connection string#

The connection string identifies the XMLA endpoint (the Data Source) and, optionally, the model (Initial Catalog).

Power BI:

Data Source=powerbi://api.powerbi.com/v1.0/myorg/MyWorkspace;Initial Catalog=MyDataset

Azure Analysis Services:

Data Source=asazure://<region>.asazure.windows.net/<servername>;Initial Catalog=<modelname>

On-premises SQL Server Analysis Services (tabular):

Data Source=<server>\<instance>;Initial Catalog=<database>

%USERNAME% and %PASSWORD% placeholders#

Anywhere in the connection string you can use the tokens %USERNAME% and %PASSWORD%. When the connection is opened, ReportWORQ replaces them with the values from the %USERNAME% Variable and %PASSWORD% Variable fields (both stored encrypted). This keeps credentials out of the visible connection string. See the Password Authentication example below.


Authentication#

OAuth Authentication (service principal)#

Use this for unattended, server-to-server access. ReportWORQ acquires an Entra (Azure AD) access token using the OAuth 2.0 client credentials grant and presents it to the XMLA endpoint. No user is involved and no credentials appear in the connection string. The token is refreshed automatically before it expires.

Select OAuth Authentication and provide:

SettingValue
Tenant IDThe Entra (Azure AD) tenant (directory) ID.
Client ID (Application ID)The app registration's Application (client) ID.
Client SecretThe app registration's client secret. Stored encrypted.
OAuth Scope (optional)Leave blank to use the default Analysis Services scope, https://analysis.windows.net/powerbi/api/.default. Override only if your environment requires a different scope.

With OAuth the Connection String contains only the endpoint (no user or password):

Data Source=powerbi://api.powerbi.com/v1.0/myorg/MyWorkspace;Initial Catalog=MyDataset

Before this will work

Password Authentication (user login)#

Use this to connect as a specific organizational user. The credentials travel in the connection string; use the %USERNAME% and %PASSWORD% placeholders so the actual values stay in the encrypted variable fields.

Select Password Authentication and set the Connection String with credential placeholders:

Data Source=powerbi://api.powerbi.com/v1.0/myorg/MyWorkspace;Initial Catalog=MyDataset;User ID=%USERNAME%;Password=%PASSWORD%

Then fill in:

SettingValue
%USERNAME% VariableThe user's organizational account, e.g. analyst@contoso.com.
%PASSWORD% VariableThe account password.

At run time the placeholders are replaced with the encrypted values and the native client signs in with them.

Note Because report generation runs unattended on the server, "user login" means organizational account credentials supplied through the encrypted variables (Active Directory password sign-in), not an interactive browser prompt. Accounts that require interactive multi-factor authentication cannot be used in this mode — use a service principal (OAuth Authentication) instead.


Running queries#

Reference the connection by its Datasource Name from the RW.Relational.Export formula. RW.Relational.Export runs the query text you provide and imports the result set into an Excel range or table.

RW.Relational.Export accepts whatever query language the connection can execute:

ConnectionSupported query languages
PowerBI XMLA - SQL (CDATA)SQL
PowerBI XMLA - ADOMDDAX, DMV, and MDX

For the ADOMD connection, the query text can be DAX, a DMV statement, or MDX. MDX queries must return a tabular (flat row-and-column) result so they can be imported into the worksheet.

DAX example

=RW.Relational.Export(A1, "PowerBI ADOMD", "EVALUATE SUMMARIZECOLUMNS('Date'[Year], ""Revenue"", [Total Revenue])")

DMV example (metadata discovery)

=RW.Relational.Export(A1, "PowerBI ADOMD", "SELECT * FROM $SYSTEM.DISCOVER_CATALOGS")

MDX example (tabular result)

=RW.Relational.Export(A1, "PowerBI ADOMD", "SELECT NON EMPTY [Date].[Year].Children ON ROWS, {[Measures].[Total Revenue]} ON COLUMNS FROM [Model]")

If an MDX query returns a shape that cannot be flattened into a table, the formula reports an error — rewrite it so the result is tabular, or express it as DAX.


Behavior and limitations#


Troubleshooting#

SymptomLikely causeResolution
Test connection fails with an authorization errorBad credentials, or the principal lacks workspace accessFor OAuth, verify the Tenant/Client ID and secret and that the service principal is a member of the workspace; for password, verify the account and password.
OAuth fails: service principals not allowedTenant admin setting disabledEnable Allow service principals to use Power BI APIs and set the XMLA endpoint to Read/Read-Write in the Power BI admin portal.
Cannot connect to a Power BI dataset at allWorkspace is not on Premium/PPU/Fabric capacityThe XMLA endpoint requires a Premium, PPU, or Fabric capacity; shared/Pro workspaces have no XMLA endpoint.
A Connection String is requiredThe Connection String field is blankProvide the Data Source=… endpoint string.
Tenant ID / Client ID / Client Secret is requiredOAuth mode selected but a field is blankFill in all three OAuth fields, or switch to Password Authentication.
Password mode fails with an MFA / interactive sign-in errorThe account requires interactive MFAUse a service principal (OAuth) or an account exempt from interactive MFA.
An MDX query returns an error instead of dataThe MDX result is not tabularRewrite the MDX so it returns a flat row-and-column result, or express the query as DAX.

Feedback on this page

Comments, questions, requests, or something missing or unclear? Email us - the page you are on is filled in for you.

Email feedback on this page

Or write to support@reportworq.com directly.