- Home
- Skills
- APIs & Backend
- pbi check loop
pbi check loop
Automates the Power BI Desktop reload loop for TMDL/PBIR edits with PID tracking and engine-state verification.
Free
Works with the AI Agents you already use
pbi check loop
Example session with this skill installed
The measure in my TMDL file is updated. Is Desktop stale, and if so, can you reload it? The project path is C:\Reports\Sales.pbip.
- Read your context and instructions
- Compiled the pbi check loop
I checked the project state. The TMDL files on disk are newer than the running instance, so a reload is recommended.
Status Report
Desktop PID 14208 · Regular · Sales - Power BI Desktop
Disk 已变更,2 个文件
Verdict 建议重载
AS localhost:51294
I am reloading the Desktop instance now. As previously agreed, this will discard any unsaved changes currently in the Power BI window.
& "$env:USERPROFILE\.claude\tools\pbi-reload.ps1" -Path "C:\Reports\Sales.pbip" -Yes -Wait
Output:
Waiting for the model to finish loading (timeout 180s)...
Ready after 18s - title settled and the model engine is up.
Analysis Services: localhost:51294 [msmdsrv 15312]
The reload is complete and the model is ready for verification.
Next steps
- Run a DAX query against
localhost:51294to verify the new measure logic. - Use
pbi-shot.ps1to confirm the visual renders correctly on the canvas. - If you changed any M partitions, remember to trigger a manual Refresh in Desktop.
Connects securely to your tools. The creator never sees your data.
About this skill
pbi-check-loop — close the loop on Power BI Desktop
Power BI Desktop has no command to reload a PBIP that changed on disk.
The sync only runs one way. Memory → disk exists: File → Save, Ctrl+S. Disk → memory has nothing. So when an agent edits a measure in TMDL, the running Desktop keeps its old model — and if you then press Ctrl+S in Desktop, it overwrites the new disk content with the stale in-memory model. The edit is gone.
This skill supplies the missing direction, plus a way for an agent to see what it produced, so AI-assisted Power BI development becomes a closed loop instead of one that stops for a human every iteration.
The two tools
pbi-reload.ps1 — check and reload.
-ListOnlyreports what is running (PID, edition, title) and whether disk files are newer than the running instance.-Yesrestarts Desktop so it re-reads TMDL and PBIR. It terminates without saving, so the stale model can never win; it cleans up the orphanedmsmdsrvprocess and reopens the same project in the same edition, with the window restored where it was.-Waitblocks until the model has actually finished loading, and prints where to query it:
Ready after 23s - title settled and the model engine is up.
Analysis Services: localhost:58894 [msmdsrv 29412]
That last line is the point. A screenshot proves the report rendered; only a query proves the numbers are right. The port is resolved by process ancestry rather than read from msmdsrv.port.txt — which, with two projects open, belongs to whichever loaded last, and will silently connect an agent to the wrong project's model.
-Wait matches the project name rather than the Untitled - Power BI Desktop title, which never settles on a localized Desktop (the zh-CN build shows 无标题).
pbi-shot.ps1 — capture the Desktop window to PNG, or -Text for plain text read through the UI Automation tree: dialog text, visual titles, matrix headers, cell values. Text is often more precise than the image — a column truncated on screen as SALES_DETAIL_BY_RE… comes back whole.
What it does not do
- It does not make loading faster. This is a restart, not a hot reload. The window does close, and the model load remains the dominant cost per iteration.
- The agent cannot operate the report. No scrolling, clicking, or page switching. If the problem is not on the current screen, a human navigates there first.
- It does not verify numbers. That is ADOMD's job, and that loop already existed.
- A reload is not a data refresh. It never goes back to source. Change a partition's M expression and that table's cached data is invalidated — it comes back empty, along with tables whose M references it. That is expected, not a broken edit.
- Not every bad edit produces a dialog. A broken calculated table opens normally and fails silently.
Relationship to the Power BI Desktop Bridge
Desktop shipped a Desktop Bridge in June 2026 — preview, build 2.155.756.0 or later, behind a Preview Features toggle. It is a local JSON-RPC server inside the Desktop process exposing four methods, and two of them overlap directly with this. Where they overlap, prefer the Bridge: its reload is in-process — no restart, no full model load, nothing destroyed if you had unsaved changes — and its snapshot renders internally rather than capturing a window.
What those four methods leave open:
- Reach. The Bridge needs a recent build and a preview toggle. Managed corporate installs do not move quickly, and Power BI Report Server Desktop is a separate product where there is no indication the Bridge exists at all. A PowerShell script runs against whatever is installed.
- Errors.
application.state.get/v1returnscurrentFilePathandhasUnsavedChanges. Nothing else. When Desktop rejects a file, no method, trace log, stderr, or event log says so — the error exists only as an on-screen dialog. - The model. No port, no query surface.
Requirements
Windows · PowerShell 5.1+ · Power BI Desktop · a .pbip project. macOS and Linux are not supported — Power BI Desktop does not exist there. MIT licensed.
Install
Unzip, then run:
.\install.ps1
It copies the two scripts to ~\.claude\tools\ and the skill to ~\.claude\skills\pbi-check-loop\, then verifies PowerShell syntax and UTF-8 BOM on every file it writes. Restart your agent to activate it.
On a multi-agent machine, always pass -Path: the script matches the project name against window titles to find your instance, and never touches another agent's Desktop.
Source and full findings: https://github.com/C-QY/pbi-check-loop
How to use
Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scanned
Verified clean 10 days ago
- Free to download with an account
Requires