DuckDB extension for querying Power BI Semantic Models with DAX.
Maintainer(s):
crazy-treyn
Installing and Loading
INSTALL pbi_scanner FROM community;
LOAD pbi_scanner;
Example
INSTALL pbi_scanner FROM community;
LOAD pbi_scanner;
SET pbi_scanner_auth_mode = 'azure_cli';
SELECT *
FROM dax_query(
'Data Source=powerbi://api.powerbi.com/v1.0/myorg/Example%20Workspace;Initial Catalog=example_semantic_model;',
'EVALUATE TOPN(500, FactSales)'
);
About pbi_scanner
Query Power BI Semantic Models from DuckDB using DAX via XMLA endpoint.
- The
dax_queryfunction executes DAX and returns results as DuckDB tables. pbi_tables,pbi_columns,pbi_measures, andpbi_relationshipsexpose INFO.VIEW metadata results for model exploration.
The easiest way to get started is Azure CLI auth (az login) with SET pbi_scanner_auth_mode = 'azure_cli', but Azure CLI is not required.
You may also use the DuckDB azure extension to create an Azure secret. More details and examples are in the pbi_scanner repository.
Added Functions
| function_name | function_type | description | comment | examples |
|---|---|---|---|---|
| dax_query | table | NULL | NULL | |
| pbi_columns | table | NULL | NULL | |
| pbi_measures | table | NULL | NULL | |
| pbi_relationships | table | NULL | NULL | |
| pbi_tables | table | NULL | NULL |
Overloaded Functions
This extension does not add any function overloads.
Added Types
This extension does not add any types.
Added Settings
| name | description | input_type | scope | aliases |
|---|---|---|---|---|
| normalize_dax_column_names | When true, strip DAX square brackets and table qualifiers from dax_query and pbi_* metadata table function column names (default off; opt in via SET or normalize_dax_column_names) | BOOLEAN | GLOBAL | [] |
| pbi_scanner_auth_mode | Default auth mode for pbi_scanner table functions (access_token, azure_cli, service_principal) | VARCHAR | GLOBAL | [] |