Use Measure Killer with AI and the CLI
Get started with the Measure Killer CLI: let an AI agent such as Claude Code run it, or run it yourself in a terminal. Set it up once, then find what is unused, clean up a model, trace the lineage or check what a change breaks.
Last updated · December 3, 2026
Measure Killer 3.0.3 comes with a command line, measurekiller-cli.exe, and
a guide written for AI agents. Together they let an agent such as Claude Code
answer Power BI questions with Measure Killer’s analysis instead of guessing
from the model files: what is unused, what a change breaks, where a number
comes from.
You ask in plain language. The agent picks the command, tells you when a sign-in window opens, reads the result files and answers. You can also run the same commands yourself in a terminal. This page gets you started both ways. Every command and option is in the CLI reference.
Measure Killer checks, your agent fixes
Measure Killer already has everything it needs to judge a model: the model’s metadata, every report and visual built on it, the lineage and the report usage. On that basis it runs deterministic checks. The same model gives the same result every time, and nothing is guessed. An AI agent is good at the other half: the edits that are slow and tedious by hand. Together, the agent works from facts instead of guesses:
| Measure Killer finds | Your agent can then |
|---|---|
| Unused columns, measures, tables and relationships | Remove them, or apply the clean TMDL copy |
| The Clean your model suggestions: hidden pages and visuals, visuals outside the page (new in 3.0.3), unused DAX variables and field parameters, auto date/time and more | Work through them, largest saving first, in your Power BI project |
| Model and report best practice violations, implicit measures, duplicate measures and columns | Fix them in the model’s TMDL and the report files |
| Broken DAX and broken visuals | Correct the expressions and point the visuals at the right fields |
| Every data source a model reads, down to the tables and columns | List them for a migration plan, an access request or the documentation |
| Where a source table or column is used, down to every visual | List the impact of a change and update the Power Query code |
| Where a KPI or calculation is used, and which source columns it needs | Explain the chain and what a change would break |
| Unused tables and columns of a lakehouse, warehouse, Fabric SQL database or dataflow | Write the cleanup for you to review |
| Report opens, page views and load times of a workspace | Propose which reports and pages to retire and which slow reports to fix first |
| Every table, column and measure with its expression and lineage | Write missing descriptions for Copilot, or the model documentation |
The CLI covers one model, report, item or data source per run, with your own access. Tenant-wide analysis and everything that needs admin rights, such as access, RLS or capacity metrics, stay in Tenant Analysis and MK Automation.
You review every change before it goes live. It works best on a Power BI
project (.pbip) under Git, where you see each change as a diff.
Quick start
-
Update to Measure Killer 3.0.3 or later. The CLI is installed with it, next to
Measure Killer.exe. -
Make sure a license is saved in the desktop app. A trial license works too. Without the app,
measurekiller-cli.exe license activate --filewith the license.json file you got from us saves it as well. -
Ask your AI agent, for example:
Run "measurekiller-cli.exe guide" from my Measure Killer installation folder and read it. Then find the unused columns and measures of the semantic model "Sales Model" in the workspace "Sales".
That is all it takes. To make the agent use Measure Killer on its own whenever a question fits, set the guide up once as a skill, see below.
Or run it yourself. Open PowerShell and try these, with the folder of your installation:
$mk = "C:\Program Files (x86)\Measure Killer\measurekiller-cli.exe"
& $mk --help
& $mk local models
& $mk service workspaces
& $mk service model --workspace "Sales" --model "Sales Model" --unused-only --out "C:\Users\me\Documents\mk\unused.csv"
local models lists the files open in Power BI Desktop and needs no
sign-in. The service commands open a sign-in window in your browser. Create
the folder for the result file first.
Set your agent up once
Give your agent the guide. The CLI ships with it in the installation folder, and it always matches the installed version:
_internal\measurekiller\cli\MEASURE_KILLER_CLI_SKILL.md
Claude Code. The guide is already a skill: it starts with the skill name
measure-killer-cli and a description of when to use it. Copy it into your
personal skills folder and Claude Code picks it up whenever you ask a
Measure Killer question. This PowerShell snippet finds the installation
folder in the registry and copies the guide:
$keys = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F1E9CBAD-B218-4FB7-A307-9EF9F0CDE864}_is1',
'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3993E507-5099-483C-87C6-1FD2DB42C0F4}_is1'
$dir = $keys | ForEach-Object { (Get-ItemProperty $_ -ErrorAction SilentlyContinue).InstallLocation } |
Where-Object { $_ } | Select-Object -First 1
$skill = "$HOME\.claude\skills\measure-killer-cli"
New-Item -ItemType Directory -Force -Path $skill | Out-Null
Copy-Item (Join-Path $dir '_internal\measurekiller\cli\MEASURE_KILLER_CLI_SKILL.md') "$skill\SKILL.md"
To share it with your team instead, copy it to .claude\skills\measure-killer-cli\
inside a project. Run the snippet again after every Measure Killer update, so
the skill matches the new version.
Other agents. Add two lines to the instructions file your agent reads,
for example AGENTS.md:
For Power BI questions about unused columns and measures, lineage, best practice
rules or report usage, use the Measure Killer CLI. Run "measurekiller-cli.exe guide"
from the Measure Killer installation folder, read it and follow it.
The guide command prints the same text and needs no license and no
sign-in.
Use cases
Name the workspace and the item as you see them in Power BI. If you do not know the exact name, the agent can list your workspaces and what they hold first.
Clean up and optimize models
“Clean up the model Sales Model.” Measure Killer finds the unused columns, measures and tables, calculation groups, KPIs and field parameters included, and writes the clean, optimized model as TMDL. The agent applies it in your Power BI project, or you paste it into the TMDL view (details).
“Go through the suggestions and fix what you can.” These are the Clean your model suggestions, and the agent saves you the most time here. Hidden pages that are no tooltip, drillthrough or navigation target, hidden visuals no bookmark uses, visuals placed outside the page, pages with no views, unused DAX variables, auto date/time, unused field parameters, relationships to unused tables, auto-detected relationships and the Analyze in Excel setting on columns nobody uses there. Each comes with its steps and the bytes it saves, and the agent works through them, largest saving first.
“Replace the implicit measures.” The best practice analysis lists every implicit measure and other DAX anti-patterns. The agent writes explicit measures and points the visuals at them.
“Merge the duplicate measures and columns.” The best practice rules flag measures and columns that duplicate each other. The agent keeps one of each, points the visuals and other measures at it, and removes the rest.
“Which model in the workspace Sales should I clean up first?” The agent analyzes each model in one session and ranks them by the size of what is unused.
“Clean up the lakehouse Sales Lake.” The agent gets the unused tables and columns of a lakehouse, warehouse or Fabric SQL database, or the unused queries and columns of a dataflow, and writes the cleanup for you to review.
Fix what is broken
“Fix the broken visuals of this model’s reports.” Measure Killer finds the visuals that render an error and the fields the model no longer has. The agent points them at the right columns and measures in the report files. Run it after every rename.
“Is any DAX broken in this model?” Every measure, calculated column and table the engine reports in error, with the error and the expression, for the agent to correct.
“Check my project before I publish it.” On a project open in Power BI Desktop, the agent checks the model with its report files: what is broken, unused or against the rules. The same checks every time, before anything reaches your users.
Best practices and your own rules
“Bring Sales Overview up to our best practices.” Pages that scroll, charts that ignore the theme colors, visuals outside the page: the agent gets every violation of the model and report rules with its place, and fixes them in your project.
“Check this model against our own rules.” Measure Killer gives the agent every table, column and measure with its name, description and expression. The agent checks them against the rules you give it, such as naming or missing descriptions, and fixes what breaks them.
Lineage and impact
“Which data sources does Sales Model use, down to the columns?” The column lineage of the model starts at its sources: every server and database, every table and view, and every column the model reads, through dataflows too. The agent lists them for a migration plan, an access request or the documentation, and marks the columns the model reads but does not use.
“Where is the source table dbo.Sales used?” Track a source table or a single column through every dataflow and Power Query step, into each model and down to every visual, filter and measure that uses it, in the workspaces you name.
“Where is the KPI Margin % used?” Every visual, filter, report and other measure that uses a measure or calculated column, also in the models and reports built on its model. The agent tells you what a change would break.
“Which source columns does the KPI Margin % need?” The agent follows the column lineage from the measure back through every measure it builds on, to the source columns and the Power Query steps in between, and explains each step.
“We are renaming the column cust_id in our database. Update our models.” Measure Killer finds every model and dataflow that reads the column. The agent updates their Power Query code in your Power BI projects, for your review.
“Can I drop the column Region of the lakehouse table Sales?” Every place that uses the column, in every model and report that reads the lakehouse.
“Show me the whole lineage of Sales Model.” From the data sources to every visual, as data for the agent or as a graph for you. The same lineage you get in the app when you right-click the model and pick View column lineage graph.
Usage
“Which reports in the workspace Sales are slow, and why?” The agent reads the load times of the workspace’s reports, takes the slowest ones and checks them against the report best practices and their models.
“Which reports and pages in the workspace Sales does nobody look at?” Opens and page views per report and page show what nobody needs. The agent prepares what to retire, and the columns and measures only used there.
“Who should I tell before I change this report?” The agent reads who opened the report and drafts a short note for them. The usage details hold email addresses, so keep them inside your company.
Copilot readiness and documentation
“Get this model ready for Copilot.” Copilot and Fabric data agents answer from your model, so unused objects, missing descriptions and unclear names make their answers worse. The agent removes what is unused and writes a description for every table, column and measure that has none, from its expression and lineage.
“Explain this model to me.” For a model you did not build: its tables, measures and relationships, what is used and where the data comes from.
“Write the documentation for this model.” The agent writes it as Markdown for your wiki or repository, from the model’s metadata and column lineage. Compare Document a semantic model in the app.
What happens while the agent works
- You sign in. Every run that reads from the Power BI service opens a sign-in window in your browser. For a semantic model on a Premium or Fabric capacity, a second window opens for the XMLA connection. The agent tells you before it starts. There is no sign-in without a person, so stay at the PC.
- It takes a few minutes. Measure Killer loads the model and every report built on it, in every workspace. Several questions in a row can share one sign-in: the agent runs them in one session.
- It reads files, not text. The agent saves the results as JSON or CSV in a folder you can write to and reads them with a script, instead of reading megabytes of tables into the conversation.
- It says what the result rests on. Every run ends with a list of what could not be loaded or what you have no access to. A column that only a missing report uses reads as unused, so the agent tells you before it calls anything safe to remove.
- It suggests the next step. After a run, Measure Killer prints hints such as “89 columns and measures are unused. List them, largest first”. The agent offers them to you instead of running them on its own.
Nothing changes without you
The CLI only reads. It never changes or deletes anything in your models, reports or workspaces, and it works with your own access. A cleanup comes back as a clean copy of the model, and you decide when to apply it: from your Power BI project, in the TMDL view, or in the Measure Killer app.
What the CLI prints, such as names, DAX and M code, goes to the provider of the agent that runs it. See Is it safe to let an AI agent run Measure Killer?
Without the CLI: Export for AI
In the desktop app, the Column lineage tab and the lineage graph window have an Export for AI button. It saves the lineage as a compact JSON file, the same format the CLI writes for an agent. Attach it to a chat with any AI assistant and ask your lineage questions there.
Related
- Measure Killer CLI reference
- Run Measure Killer from the command line
- Where is measurekiller-cli.exe?
- MK Automation, for scheduled runs without a person
Something wrong or out of date on this page?