Measure Killer Measure Killer

How do I find and remove the unused columns and measures of a semantic model with the CLI?

Run measurekiller-cli.exe service model with the workspace and the model name, or local analyze for a file open in Power BI Desktop, and save the unused objects with --out. Add --clean-tmdl to get the model without them: a TMDL folder for your Power BI project, a zip, or a TMDL script to paste into the TMDL view. Or ask your AI agent to do it.

Last updated · December 1, 2026

Steps

  1. Find the model: service workspaces lists the workspaces you can open, service items lists what one workspace holds, with the IDs (details).

  2. Run service model with --workspace and --model, and save the result with --out and a full path. The file ending picks the format: .csv, .xlsx or .json. Add --unused-only to keep only what is unused (details).

  3. For a file that is open in Power BI Desktop, run local models, then local analyze. Pass the report files with --report or --report-folder, otherwise everything that only a report uses shows as unused.

  4. Read the list named “Missing from the result” at the end of the run. A run can finish while some reports or models could not be loaded (details).

  5. Add --clean-tmdl PATH to get the model without what is unused. The PATH picks the form (details):

    • a folder: a TMDL folder, to use as the definition folder of a Power BI project (.pbip)
    • a .zip file: the same folder, compressed
    • a .tmdl file: one script to paste into the TMDL view, in Power BI Desktop or in the browser, and apply
  6. Review the clean model and apply it. The CLI never changes the model in your tenant. A removed source column also leaves the Power Query code, so a refresh does not load it again.

In the same run, --suggestions FILE saves the other suggestions of the app that make the model smaller or simpler, --best-practices FILE the best practice rule violations, and --broken-dax FILE the DAX in error.

Go deeper

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.