connect-pbid
TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, DAX library package management (daxlib.org), and the Desktop Bridge for reloading and screenshotting the report canvas. Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop
npx skills add data-goblin/power-bi-agentic-development --skill connect-pbid --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
What it does
Guides an agent to connect to Power BI Desktop's local Analysis Services using TOM and ADOMD.NET via PowerShell. It covers loading TOM assemblies, connecting to localhost ports, enumerating model objects (tables, relationships, etc.), executing DAX queries, performing data refreshes, and saving changes. It also includes workflow for handling multiple desktop instances, loading ADOMD.NET, running DAX queries with SUMMARIZECOLUMNS, and closing connections. It mentions using the Desktop Bridge for reloads and screenshot-related actions when the report canvas is in scope, and it delegates visuals to a separate pbir-cli skill for editing visuals. It emphasizes not using remote XMLA endpoints and to route report-canvas tasks to the appropriate tooling.
How it works
- Load required assemblies for TOM and ADOMD.NET from NuGet environments and prepare Add-Type calls.
- Discover port(s) where PBI Desktop hosts a local Analysis Services instance and connect to the first suitable port using Data Source=localhost:<PORT>.
- Access the single database as $db and obtain $model = $db.Model; perform model enumeration (tables, columns, measures) and inspect relationships.
- Save changes with $model.SaveChanges() after a batch of modifications, and always disconnect with $server.Disconnect().
- Use ADOMD.NET to open a connection and execute DAX queries via SUMMARIZECOLUMNS, iterating results by index and mapping columns with GetName().
- Use TMSL or TOM’s RequestRefresh for model refreshes, and provide various refresh types (full, calculate, automatic, dataOnly).
- Provide guidance for correlating ports to specific reports using pbir desktop list when available.
- For visuals and report canvas actions, route to pbir-cli and Desktop Bridge operations; the skill itself does not edit visuals.
When to use it
Activate when the Tabular Editor CLI or a Power BI MCP server is unavailable. It is preferred when TOM validates changes against the engine and applies them atomically. It explicitly warns that remote XMLA connections are not supported and directs to appropriate alternatives for Direct Lake or Fabric-hosted models.
What it can touch
- The local Analysis Services instance via TOM/ADOMD.NET on localhost ports.
- The in-memory model object graph (tables, models, relationships, measures, etc.) and saving changes via $model.SaveChanges().
- The report canvas indirectly through the Desktop Bridge for reloads and screenshots (when in scope).
- PowerShell environment and NuGet-installed DLLs used by TOM and ADOMD.NET.
Caveats
- Requires Power BI Desktop to be open with a loaded model on localhost.
- Does not support remote XMLA endpoints; directs users to Tabular Editor CLI or MCP for Direct Lake/Fabric scenarios.
- Multiple PBI Desktop instances require port-to-report correlation; pbir tooling is recommended for mapping.
- Always use -ExecutionPolicy Bypass for PowerShell commands; ensure proper script management and SaveChanges after edits.
- Changes must be persisted with $model.SaveChanges() to avoid loss.
- The skill expects a specific environment with NuGet, TOM, and ADOMD.NET packages installed; installation steps are embedded in the script exemplars.
# Connect to Power BI Desktop (Local Analysis Services) > **CRITICAL:** Record mistakes, surprises, and model-specific nuances encountered while using this skill in `.claude/rules/connect-pbid.md`. This file must begin with "Learnings from Claude about connecting to semantic models via the connect-pbid skill". Write only active reference notes (e.g. "QueryGroup property returns an object; access .Folder for the name string"); do not log a changelog or history of events. Omit anything already documented in the skill or its references. Keep the file under 1500 characters at all times; prune stale entries when adding new ones. Do not over-attend to this file; update it only when something genuinely unexpected is discovered. > **Note:** No MCP server is required. Use PowerShell with TOM/ADOMD.NET for the local model. > When the report canvas is also in scope, pair it with `pbir` for report operations; never patch > report JSON directly. Expert guidance for connecting to Power BI Desktop's local tabular model via the Tabular Object Model (TOM) and ADOMD.NET in PowerShell. Covers connection, enumeration, DAX queries, query traces, and full model modification. ## When to Use This Skill Ac
- When to Use This Skill
- Model and report: routing
- Critical
- 1. Prerequisites
- 2. Quickstart
- 2a. Correlating Ports to Reports (Multiple Instances)
- 3. Loading TOM, Connecting, and Saving Changes
- Load Assemblies
- Connect
- Save Changes
- Disconnect
- Connection Properties
- 4. Refreshing the Model
- 5. Querying with DAX
What does the connect-pbid skill do?
TOM and ADOMD.NET guidance via PowerShell for connecting to Power BI Desktop's local Analysis Services instance. Covers model enumeration, DAX queries, metadata modification, annotations, calendar definitions, field parameters, query tracing, DAX library package management (daxlib.org), and the Desktop Bridge for reloading and screenshotting the report canvas. Automatically invoke when the user mentions "Power BI Desktop", "Analysis Services port", "TOM", "ADOMD", "daxlib", "DAX library", "DAX UDF package", or asks to "connect to PBI Desktop", "query PBI Desktop with DAX", "modify PBI Desktop
How do I install it?
Run `npx skills add data-goblin/power-bi-agentic-development --skill connect-pbid --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From data-goblin/power-bi-agentic-development, a repository with 833 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
