connect-pbid

Connects to Power BI Desktop's local Analysis Services instance via TOM and ADOMD.NET for model queries and modifications.

6|3|Updated Jul 4, 2026
One-click install
npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill connect-pbid-insightfulanalytics
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: connect-pbid
Source: https://github.com/InsightfulAnalytics/PBI_Agentic_Dev/tree/main/plugins/pbi-desktop/skills/connect-pbid
Command: npx skills add https://github.com/InsightfulAnalytics/PBI_Agentic_Dev --skill connect-pbid-insightfulanalytics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jq, and includes scripts (resource) and references (resource) components.

What problem does it solve? Power BI Desktop runs a hidden local Analysis Services engine, but there is no built-in way for an agent to query or modify the open model programmatically. This Skill provides the PowerShell-based TOM and ADOMD.NET guidance to discover the engine's port, connect, run DAX queries, and safely edit model metadata without manual clicking in the Desktop UI. ## Core Features & Use Cases - Model Connection & Enumeration: Discover msmdsrv.exe listening ports, correlate them to open PBIX/PBIP files, load TOM assemblies, and enumerate tables, columns, measures, and relationships. - DAX Querying & Validation: Execute DAX queries via ADOMD.NET, validate measure expressions before saving, and capture query traces from the report canvas. - Model Modification: Create, update, and delete measures, columns, relationships, roles, field parameters, calendar definitions, and annotations with atomic SaveChanges transactions and rollback. - DAX Library Management: Search, download, install, and remove daxlib.org DAX function packages using the bundled daxlib.sh CLI. - Use Case: You have a PBIP file open in Power BI Desktop and need to add 20 formatted measures, verify them with test DAX queries, then reload and screenshot the report canvas to confirm the visuals update correctly. ## Quick Start Ask the agent to connect to the open Power BI Desktop file and list all tables and measures in the model.

Frequently Asked Questions about connect-pbid

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Power BI Desktop's local Analysis Services instance?▼

Find the listening port of the msmdsrv.exe process using Get-NetTCPConnection, load the TOM assemblies with Add-Type, then connect with a Tabular Server object to Data Source=localhost:<port>. Power BI Desktop must be open with a model loaded before connecting.

How do I run DAX queries against Power BI Desktop from PowerShell?▼

Load the ADOMD.NET assembly, open an AdomdConnection to localhost:<port>, and execute EVALUATE statements with SUMMARIZECOLUMNS. Access result columns by index using GetName(), since ADOMD returns fully-qualified names that fail on short-name lookups.

Can I use TOM with Direct Lake or remote Fabric semantic models?▼

No. This approach only works with Power BI Desktop's local engine and does not support remote models via the XMLA endpoint. For Direct Lake or Fabric-hosted models, use the Tabular Editor CLI or a Power BI MCP server instead.

Why does Add-Type throw ReflectionTypeLoadException when loading TOM assemblies?▼

Windows PowerShell 5.1 runs on .NET Framework and cannot load .NET 8 assemblies like the unified Microsoft.AnalysisServices package. Use the .retail.amd64 net45 build, switch to PowerShell 7, or run from a net8.0 project instead.

How do I install DAX library packages from daxlib.org into a model?▼

Use the bundled daxlib.sh CLI: run daxlib search to find packages, then daxlib add <package-id> --port <port> to install functions into the open Desktop model. Standalone commands like search, info, and download work without Power BI Desktop.

What happens if I edit model metadata without calling SaveChanges?▼

Changes made through TOM are discarded unless you call $model.SaveChanges(), which applies all pending modifications in one atomic transaction. If validation fails, the entire batch rolls back, and UndoLocalChanges() can discard uncommitted edits manually.