Measure Killer Measure Killer

Measure Killer CLI

Run Measure Killer from the command line or through an AI agent: where it is installed, how to get started, every command, and what it does not do.

Last updated · December 3, 2026

The Measure Killer CLI is the command line version of Measure Killer. You can run it yourself in a terminal, or let an AI agent such as Claude Code run it for you and work with the results. It finds unused columns and measures, writes a clean copy of the model without them, traces the full column lineage of a model from the data sources down to every visual, finds broken DAX and broken visuals, checks best practice rules, shows what uses an item and reads report usage.

At a glance

Programmeasurekiller-cli.exe, installed with Measure Killer 3.0.3 and later, in the same folder as Measure Killer.exe
LicenseThe license saved in the desktop app, paid or trial. There is nothing to set up
Sign-inIn your browser, with the same account you use in the app
ScopeOne semantic model, one item or one data source per run
AccessYour own. The CLI never grants itself access to a workspace
ChangesNone in your tenant. To clean up a model, it writes a clean copy that you apply

Get started

  1. Update to Measure Killer 3.0.3 or later. The CLI is installed automatically with it.

  2. Make sure a license is saved in the desktop app, see License keys. If you do not have one, you can request a trial license here.

  3. Tell your AI agent to run the CLI and explore what it can do. 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".

The agent reads the guide that ships with the CLI, runs the commands and tells you when a sign-in window is about to open. To set the guide up once as a skill, and for questions worth asking, see Use Measure Killer with AI and the CLI.

If you would rather run it yourself, open PowerShell and call the program with its full path:

$mk = "C:\Program Files (x86)\Measure Killer\measurekiller-cli.exe"
& $mk --help
& $mk service model --workspace "Sales" --model "Sales Model" --out "C:\Users\me\Documents\mk\usage.csv"

Where the program is

Every installer of Measure Killer includes the CLI: the standard installer, the portable installer, the MSI and the Microsoft Store version. The CLI is not on your PATH. It sits in the installation folder of Measure Killer:

InstallFolder
Standard installer or Microsoft Store (needs admin rights)C:\Program Files (x86)\Measure Killer\
MSI installer (needs admin rights)C:\Program Files (x86)\Measure Killer\ by default
Portable installer (no admin rights)%LOCALAPPDATA%\Programs\Measure Killer\ by default, or the folder you picked

That folder holds Measure Killer.exe (the desktop app), measurekiller-cli.exe (the CLI) and a folder named _internal. An install older than 3.0.3 has no measurekiller-cli.exe: update first.

If you or your agent cannot find it, this PowerShell snippet reads the folder from the registry. Every installer writes its folder there:

$places = @{ Key = 'HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F1E9CBAD-B218-4FB7-A307-9EF9F0CDE864}_is1'; Value = 'InstallLocation' },  # standard installer, Microsoft Store
          @{ Key = 'HKLM:\SOFTWARE\WOW6432Node\Brunner BI GmbH\Measure Killer'; Value = 'Path' },  # MSI installer
          @{ Key = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{3993E507-5099-483C-87C6-1FD2DB42C0F4}_is1'; Value = 'InstallLocation' }  # portable installer
$mk = $places | ForEach-Object { try { Get-ItemPropertyValue -Path $_.Key -Name $_.Value -ErrorAction Stop } catch { } } |
      Where-Object { $_ } | ForEach-Object { Join-Path $_ 'measurekiller-cli.exe' } |
      Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
$mk

It tries the standard installer first (the Microsoft Store runs the same installer), then the MSI, then the portable installer, and takes the first folder that holds measurekiller-cli.exe. No result means that Measure Killer 3.0.3 or later is not installed.

The guide for AI agents

The CLI ships with a guide written for AI agents. It describes every command, every option, the columns of the result files, the exit codes and the traps.

  • measurekiller-cli.exe guide prints it. This needs no license and no sign-in.

  • The same text is a Markdown file inside the installation folder. If your agent cannot run the program yet, point it to this file:

    _internal\measurekiller\cli\MEASURE_KILLER_CLI_SKILL.md

The guide always matches the installed version, so let the agent read it again after an update.

License and sign-in

  • License. Every command first checks the license that the desktop app saved. If there is none, activate one in the app, or in the CLI with license activate --file and the license.json file you got from us (or --key and --signature). It is saved in the same place as by the app. license check tells you whether the saved license is accepted.
  • Double-click. A double-click on measurekiller-cli.exe in File Explorer opens the shell in its own window.
  • Sign-in. The service commands open a sign-in window in your browser. The local commands work on files that are open in Power BI Desktop and need no sign-in.
  • One sign-in per run. Nothing is remembered between two runs. To run several commands with one sign-in, use shell.
  • Models on a capacity. A semantic model on a Premium or Fabric capacity is read through its XMLA endpoint, which asks for a second sign-in in a separate window.
  • Someone has to be at the PC. There is no service principal and no saved password. For scheduled runs without a person, see MK Automation.

Commands

CommandWhat it does
local modelsLists the files that are open in Power BI Desktop
local analyzeUnused columns and measures of an open file. Pass the report files with --report or --report-folder, otherwise everything that only a report uses shows as unused
service workspacesLists the workspaces you can open
service itemsLists what one workspace holds, with the IDs
service modelUnused columns and measures of one semantic model
service reportBest practice rules of one report
service report-usageOpens, page views and load times of the reports of one workspace
service dataflow, service lakehouse, service warehouse, service sql-databaseUnused tables and columns of one item
service datasourceStarts at one data source (SQL Server, PostgreSQL, MySQL, Oracle, Google BigQuery, Azure Synapse, Snowflake, Databricks, Excel, CSV or Analysis Services) and pulls everything downstream of it that you have access to: who reads which column, and whether it is still used. Name the source with --kind, --server and --database, and the workspaces to scan with --workspace. An Azure Synapse SQL pool is a sql_server source
service lineageWhat uses one item, as a table or as an HTML graph you can open offline
shellRuns several commands with one license check and one sign-in
license checkChecks the saved license
license activateSaves a license on this PC, from the license.json file (--file) or from the key and signature
guidePrints the guide for AI agents

--help works on every level, for example:

measurekiller-cli.exe service model --help

Options you will use most:

OptionWhat it does
--out FILESaves the result table. The file ending picks the format: .csv, .xlsx or .json
--unused-onlyKeeps only what is unused
--failed FILESaves the list of what could not be loaded, also when nothing is missing
--best-practices FILE, --rules FILESaves the best practice rule violations of a model, or every rule with its result
--broken-visuals FILE, --broken-dax FILESaves the broken visuals and the broken DAX of a model
--suggestions FILESaves the suggestions of the app that make a model smaller or simpler, each with its steps (.json)
--clean-tmdl PATHWrites the model without what is unused, see Clean up a model. The model itself is not changed
--column-lineage FILE, --lineage-of TARGETSaves the column lineage of the whole model, from the data sources through dataflows and Power Query down to every visual: .html as a graph to open in a browser, .json as the “Export for AI” data for an agent. --lineage-of starts it at one column, measure or visual instead
--html FILESaves the lineage graph of service lineage as a page (--dark for the dark theme)
--jsonPrints the result as one JSON document, for scripts and agents
--workspace-id, --model-id and similarPicks an item by its ID when two items share a name

Results

  • Use full paths for result files, and create the folder first. The installation folder under Program Files is not writable for a normal user.
  • An existing file is overwritten without a question.
  • Every run ends with a list named “Missing from the result”. Read it: a run can finish while some reports or models could not be loaded.
  • After a run, lines starting with Hint: suggest what else the CLI can do with the same item, with the command to run.
Exit codeMeaning
0The command ran to its end
1Error, the message says why
2Wrong arguments, nothing was done
3The sign-in failed, was cancelled or timed out
4No license saved, or the license was not accepted

Clean up a model

The CLI does not change your model, but it can hand you the model without what nobody uses. --clean-tmdl on service model or local analyze removes the unused columns, measures, hierarchies, tables, relationships, DAX functions and unloaded queries from a copy, and writes that copy in the form you pick:

PATHWhat you getWhat to do with it
A folderA TMDL folderUse it as the definition folder of a Power BI project (.pbip)
A .zip fileThe same TMDL folder, compressedKeep or share it, unzip it into a project
A .tmdl fileOne TMDL script that starts with createOrReplacePaste it into the TMDL view, in Power BI Desktop or in the browser, and apply it
  • A removed source column also leaves the Power Query code of its table, so a refresh does not load it again.
  • Pass every report that uses the model (--report for local analyze), and read the list of what is missing first. A column that only a missing report uses counts as unused and is removed from the copy.
  • An existing folder is overwritten. Point it at the definition folder of a project only when that is what you want, and keep the project in Git so you can compare and undo.
  • service model --clean-tmdl needs a workspace on a Premium or Fabric capacity.
  • --suggestions FILE saves the other suggestions of the app that make a model smaller or simpler, each with its steps.

Security

From a security point of view there is no difference between the CLI and the desktop app. It uses the same license and the same sign-in, it works with your own access, and it only reads. See the Trust Center for how Measure Killer handles your data.

One thing to keep in mind: if you let an AI agent run the CLI, what the CLI prints, such as names, DAX and M code, goes to the provider of that agent.

What the CLI does not do

  • Change or delete anything in your tenant. A clean model is a copy you review and apply yourself, see Clean up a model.
  • Analyze a whole workspace or a whole tenant in one run. That is Tenant Analysis in the desktop app.
  • Anything that needs admin rights, such as the admin scan or the activity logs.
  • Run without a person, or on a schedule. That is MK Automation.

Something wrong or out of date on this page?

Report an issue with this page

Tell us what is wrong or out of date. No email needed.