
Measure Killer
an external tool for Microsoft Power BI Desktop.
Cleaning up your Power BI tenant
Measure Killer can help you clean and optimize your tenant. This can drastically reduce dataset refresh times and thus lower the memory and CPU usage of your Premium capacity. Since we use the XMLA connection, the dataset can remain in the service. Additionally, we only analyze the metadata, we do not read the actual data in your dataset.
Deleting unused measures
Measure Killer can delete unused measures on its own if the user chooses so. Alternatively it can generate a C# script for the measures to be deleted via Tabular Editor manually.
Deleting unused columns will also improve performance since less RAM will be consumed.
Deleting unused columns
Measure Killer will generate an M-Code to delete unused columns. This code can be pasted into Power Query's Advanced Editor to remove these columns from the model.
Analyzing reports
For every report analyzed, Measure Killer will generate a comprehensive Excel file to show where an artifact is used. This can be in: Measures, Visuals, Filters, Conditional Formatting, Joins in Power Query, or other parts of a Power BI Report such as Relationships.
Furthermore, Measure Killer can generate a chart to show the number of unused and used columns and measures.



What does Measure Killer detect?
-
Visuals - including filters applied to visuals, on pages or the whole report.
-
Artifacts only used in custom visuals (see compatibility matrix below for details)
-
Any kind of measure or relationship
-
Columns used exclusively in Power Query, e.g. in joins, appends, references etc.
-
Calculated columns
-
Calculated tables
-
Conditional formatting
What does not work?
-
If you copy whole reports and then only do some minor changes, this can lead to false references.
-
If you create new queries from existing queries in Power Query it is possible that MK will reference columns (e.g. selected columns / removing columns) that have already been removed in the existing query.
-
If a query B (child) references a query A (parent) via e.g. an append, join etc. and those queries have the same column names. If we now have an M reference in one of these columns in query B it will wrongly flag the same column in query A as used.
-
DAX expressions like COUNTROWS that only reference a table are not considered unless there is a column or measure referenced as well.
-
Calculated columns and calculated tables need to be deleted manually
-
Several runs may be necessary to delete all unused columns and measures. (There can be artifacts, that are only referenced in unused measures or columns but are not actually used anywhere in the report.)
-
Default titles and subtitles (created by Power BI / default) will not be recognized. If you change the titles in any way they will be detected though.
Measure Killer Compatibility
legend
✅ fully compatible
? limited compatibility
✗ currently not working
General:
✅ .pbix (Desktop and Desktop RS)
✅ .pbix (Uploaded to PBI Service)
✅ Thin file uploaded to PBI Service
✅ DirectQuery
✅ Composite models
✗ Thin files (.pbix live connection) that cannot be download using the Power BI Service - link
✗ Dashboards
✗ Paginated reports (we are currently working on adding this)
✗ Analyze in Excel (we might be able to add this soon)
✗ Any type of live connection (SSAS, AAS, Datamarts) - create a local mode (DQ) to make it work!
✗ .bim files / models stored in a folder etc.
✗ Metrics (Goals)
Feature compatibility:
✅ Row-level security
✅ Calculation groups
✅ Field parameters
✗ KPIs (created in the tabular model)
✗ Object-level security (When an artifact is only used in OLS, Measure Killer will not detect it)
Compatibility of visuals:
✅ Standard visuals (all, unless listed below)
✅ Icon Map
✅ Zebra BI visuals
✅ HTML VizCreator Cert
✅ HTML VizCreator Flex
✅ Balance Sheet Visual
? Other custom visuals (We have not tested Measure Killer for all custom visuals)
✗ Q&A visual
✗ Paginated report visual
✗ Metrics (Goals) visual

Measure Killer pricing
Most features of this tool are free to use personally and commercially.
The analysis of shared/golden datasets in the Power BI Service (third module in the client application - greyed out if you have not entered a valid license key) is a paid upgrade however.
The only difference to the free version is that your datasets and thin reports can remain in the Power BI service and Measure Killer will find and analyze them automatically.
To unlock this feature, please purchase a license below.
If you have any questions regarding licensing, please reach out to us via "contact" at the top right of this website.
Important information and versioning
There is one version which requires admin rights, here, Measure Killer will automatically be added to the External Tools in Power BI. The portable version, which does not require admin rights, will not show up as an external tool.
Since Measure Killer is rather new, there may be bugs, if you experience any, please let us know here.
Measure Killer creates a hidden "temp_" folder for each report analyzed. This folder will be saved in the same folder as the Power BI file. The temp folder is nothing else but an extracted .pbix file.
The copying and pasting of visuals between live/thin reports may result in false positives (artifacts being wrongly identified as used even though they are not).
Measure Killer - Download and Changelog
Current version 0.9.10
Also available in the Microsoft Store now (Admin version)
Release Notes for 05/19/2023
Version 0.9.10
[BUG FIXES]
-Fixed an issue that prevented all reports from being removed from the report list.
-Implemented a "Stop" button to end the process running in a separate thread, preventing it from continuing if the window is closed -after "Run".
-Improved error handling for instances where ".pbix" file paths were incorrect (moved or deleted), which caused a "Could not retrieve filters data" bug.
-Resolved a bug with page-level filters.
-Stopped automatic report downloads after closing Measure Killer in online mode.
-Fixed an issue causing the page for page-level filters in the main window to be blank.
-Corrected a false negative issue with the TopN Filter of visuals.
-Improved workspace sorting (first dropdown in the process/UI) for accuracy.
-Corrected a false negative when referencing tables with specials characters in thin/live reports.
-Enforced a requirement for at least one valid report to run Measure Killer in online mode.
[FEATURES]
-Auto-check for new versions of Measure Killer.
-Tooltips for buttons, providing explanations for their functionalities.
-Reverse sorting (Z-A) for lists and dropdowns in the online mode.
-Removed "Show Results" button for a streamlined experience.
-Implemented a progress label, providing real-time count of artifacts analyzed.
-Enhanced excel export by including visual title and subtitle for visuals.
-Included multiple notebooks in the main window: Information, Execution, and Killing logs for better organization and tracking.
-Added auto-copying of C# script for deleting measures to the clipboard.
-Displayed the dataset name in the main window for online mode.
Older versions
Release Notes for 04/24/2023
Version 0.9.9
[BUG FIXES]
Resolved "Measure" key issue in live/thin reports with broken measures.
[FEATURES]
-Enhanced Shared Datasets Online Mode UI (Basic/Enterprise).
-Use [DEL] & [ENTER] to include/exclude reports in Shared Dataset Online Mode.
-Workspace search & sort options added.
-Report names now included in layout errors.
-More sorting options in online mode.
Release Notes for 04/07/2023
Version 0.9.8
[BUG FIXES]
-Resolved an issue where measures or columns in the rule option for conditional formatting were not being detected.
-Fixed the "Delete selected" button bug in the "Edit reports" section for live connections on local machines.
-Addressed the Group ("Single visual") bug when grouping visuals.
-Prevented the Settings window from opening twice.
-Removed the "MK_" prefix from the beginning of the saved results Excel file name.
-Corrected a bug where some columns were omitted from the report.
[FEATURES]
-Added the ability to backup and restore measures deleted by Measure Killer.
-Implemented a new and more secure authentication (license) method.
-Introduced an "Expand All" option in the main window.
Release Notes for 03/20/2023
Version 0.9.7
[Features]
-Added the ability to configure proxy options for API calls and Azure identity verifier.
[UI]
-Online mode now takes users back to the Workspace and Dataset window, rather than resetting the Measure Killer tool to its initial state.
-Dataset and Workspace selection window is now resizable, giving users more control over the size and layout of the window.
Release Notes for 03/15/2023
Version 0.9.6
[Bugs]
-Improved error handling
-Smart narrative visual fixed
Release Notes for 03/08/2023
Version 0.9.5
[Features]
-Added Shared/golden Dataset online mode.
Users can now select a dataset and Measure Killer will detect all connected reports in workspaces that the user has access to. For this mode, no local files are needed anymore.
-Enhanced detection of artifacts in visuals.
-Significantly reduced number of false positives
-Strongly improved Power Query M logic
[UI]
-The user interface has been improved with rearranged buttons, reduced windows, and a menu bar has been added.
-Users can choose to either "Remove other columns" or "Remove columns" to "kill" columns.
-Added a menu for Measure Killer's main window (less buttons).
-Users now have the option to choose one of 11 color themes for the entire Measure Killer application.
[Bugs]
-False positives for substrings in visuals have been fixed.
-Fixed duplicates in where artifact are used.
-The main window no longer becomes "not responding" in bigger reports.
-Fixed multiple steps with the same name, "Columns removed by Measurekiller"
-Fixed calendar artifacts usage bug.
Release Notes for 01/05/2023
Version 0.9.2
[MISC]
-Fixed a bug with "filter on this page" and "filter on all pages"
Release Notes for 12/07/2022
Version 0.9.1
[MISC]
- Updated the installer
- Fixed offline bug where Measure Killer was not loading
Release Notes for 12/05/2022
Version 0.9
[ FEATURES ]
- Added connection to shared datasets and live/thin reports (offline and via XMLA endpoint for premium workspaces)
- Improved results table
[UI]
- rearranged buttons and added some functional buttons e.g "back button"
- changed formatting of results table
Release Notes for 10/17/2022
Version 0.8
[ FEATURES ]
- Added option to kill measures directly in Measure Killer without using Tabular Editor
- Added feature to sort columns
- Added detection of columns used only by incremental refresh
- Added (DAX) expression column for Excel output
- Added new report option (row by row) when saving the results file
- Self-update after killing measures (the user doesn’t have to click on run again)
[MISC]
- Added error handling for blank file selection
- var. smaller bug fixes
Release Notes for 10/06/2022
Version 0.7
[UI]
-You can now see how costly (in terms of storage space) your unused columns are
-Table overview of unused artifacts
[MISC]
- var. bugfixes and performance improvements
Release Notes for 9/16/2022
Version 0.5
[UI]
- Rearranged Buttons.
[MISC]
- Fixed an error that caused false positives if measure names would contain " and '.
Release Notes for 9/7/2022
Version 0.4
[ FEATURES ]
- Added M code to automatically remove columns.
[UI]
- Improved UI and added colored buttons.
Release Notes for 8/27/2022
Version 0.3
[ FEATURES ]
- Added C# script to remove measures.
- Added option to plot results.
[ MISC ]
- Removed info page on startup.
Security information and documentation
This section will shed some light on the API calls Measure Killer makes.
Measure Killer can also run completely offline though.
Please also be aware that Measure Killer only analyzes metadata (like the name of your column or the DAX expression) but never what is inside your column/rows. That is also why the speed of the analysis depends on the number of artifacts (visuals, measures etc.) in your report and dataset and never depends on the size of your dataset.
Power BI REST APIs
This Python code uses the Power BI REST APIs to interact with Power BI data. The code provides several methods for accessing information, including accessible workspaces, datasets in a particular workspace, reports in a particular workspace, and the layout of a particular report.
API calls made
-
authenticate(): Uses the Azure identity package to authenticate with the Power BI API and retrieve an access token.
-
workspaces(): Gets all accessible workspaces using a GET request to https://api.powerbi.com/v1.0/myorg/groups.
-
datasets(wk_id:str): Gets all datasets in a particular workspace using a GET request to https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/datasets.
-
reports(wk_id:str): Returns all reports in a particular workspace using a GET request to https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/reports.
-
report_layout(wk_id:str,re_id:str): Extracts the report layout in JSON format using a GET request to https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/reports/{re_id}/Export.
The API calls are made using the requests package in Python, which sends HTTP requests to the Power BI API. The requests.get() method is used to make GET requests to the API endpoints. The access token is passed in the headers of the request, and the response is returned as a JSON object.
URLs used
-
Authentication: https://analysis.windows.net/powerbi/api/.default
-
Get all accessible workspaces: https://api.powerbi.com/v1.0/myorg/groups
-
Get datasets in a particular workspace: https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/datasets
-
Get reports in a particular workspace: https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/reports
-
Extract the report layout in JSON format: https://api.powerbi.com/v1.0/myorg/groups/{wk_id}/reports/{re_id}/Export
Note: {wk_id} and {re_id} are placeholders for the workspace ID and report ID, respectively.
Documentation
Installation
There are two different versions. An "admin" version and a "non-admin" or portable version. In order to be able to install the admin version, the user must have administrator rights in the system. But basically the two versions work exactly the same. The only disadvantage of the "non-admin" version is that Measure Killer will not be automatically added to the "External Tools" in Power BI Desktop. Measure Killer in the Microsoft store is the "admin" version.
For the basic and enterprise version the MSOLAP package needs to be installed to ensure XMLA connection. You might need to download and install it from Microsoft.
Used python libraries
sys, pyadomd, pandas, numpy, tkinter, os, json, shutil, re, subprocess, psutil, pyperclip, webbrowser, matplotlib
Instructions
Measure Killer can be easily opened in the "External Tools" in Power BI. If the "Non-Admin" version is used, the tool must either be run via the .exe file or added manually to the "External Tools". The port will be automatically added from the report in which the Measure Killer was started. In addition, the last opened .pbix file is pre-selected as the file path.
Running Measure Killer
-
There are three choices when starting Measure Killer:
-
Start
-
Single report and dataset: This is the most basic way to use Measure Killer. Only one report/dataset can be analyzed per run (same file).
-
Shared/golden dataset on local machine: We can analyze multiple reports having a live connection to this dataset. We need to have all files locally however.
-
Shared/golden dataset online via XMLA: All files can remain in the Power BI Service, we can analyze a dataset and x number of connected reports which Measure Killer will find automatically (if the user has access to the various workspaces).
-
Single report and dataset
This will take you directly to the main page of Measure Killer. If you launch MK from within Power BI External Tools, the port will already be pre-selected (drop down field on the top left). If you start MK separately, you will need to select it yourself, however. You further need to select the report and correct path, you will automatically see the last opened Power BI file on top of the list. Click run to start the analysis.
Measure Killer is now doing its magic. To show the user the progress and what is currently being done, a progress in percentages is displayed in the left window. Once this process has finished, click on show results.
The main table displays the results of the analysis. You will be able to see which artifacts are used, the size of the columns and other information like on which page of the report a measure is used or the type of visual it is used in. It is possible to expand each of the used columns and measures, by clicking on the plus icon to the left of the column/measure name. This will show you, where exactly the artifact is used in the report. To expand all used objects with one click, use the expand button.
Additionally, these results can be displayed in more detail by selecting save results on the top left.
You can choose between two different Excel reports: save row by row report and save clustered report". In the row by row report, each use of an artifacts is displayed in one row. For example, if you the [Sales] column is used 8 times (e.g. in measures, calc. columns, visuals etc.), you will get 8 rows in the output. The "clustered" report, on the contrary, contains only one row for each artifact.
To only see the unused measures and columns, click on the unused button . Additionally, for a quick overview, you can bring up a bar chart under plot results in the menu on the top, showing the number of used and unused artifacts.
You can delete unused measures directly in Measure Killer, by clicking on kill measures and columns -> kill measures and selecting if you want to kill all unused measures, or if you want to select only specific measures to kill. Alternatively you can also generate a C# script.
Should you happen to delete an unused measure and later realize that you actually still need it, you can now restore measures by clicking on restore measures. You get a list of your previously deleted measures. This feature is currently still in preview so make sure to keep backups in case something goes wrong. It is important to understand that all deleted measures will be shown here (also from other reports).
For deleting unused columns, you have to select the option kill columns. A popup window appears, where you can choose whether you want to select the columns you want to delete (“Remove columns” syntax in PowerQuery), or whether you want to only keep the selected columns (“Remove other columns” syntax in PowerQuery). Now select the columns, click on apply and copy the M code. Now open the Advanced Editor of the respective table in Power Query and paste the copied M Code, replacing the existing code. You can see that now there is a new step in your transformation protocol.
The functionality of each button is explained in more detail further down in this document.
Shared/golden dataset on local machine
First you need to make sure to have the dataset to be analyzed and all live/thin reports locally on your computer. We recommend putting all report files in one separate folder. The dataset has to be open in Power BI, only then you will find its port in the dropdown. Click on refresh if you have just opened the file so MK can search for it again.
Now you need to add the dataset by clicking on edit report list and then add a new .pbix file. Select your dataset here, this is very important. After that you can select the live/thin reports. Either individually with add a new .pbix file or a whole folder full of .pbix files via live/thin reports from a folder. Once all files you want to analyze have been selected, double check if the dataset and thin files have been identified correctly, then click submit.
Measure Killer will double check to make sure we have identified the correct dataset.
You will then be taken to the main window. Click run to start the analysis.
Measure Killer is now doing its magic. To show the user the progress and what is currently being done, a progress in percentages is displayed in the left window. Once this process has finished, click on show results.
The main table displays the results of the analysis. You will be able to see which artifacts are used, the size of the columns and other information like on which page of the report a measure is used or the type of visual it is used in. It is possible to expand each of the used columns and measures, by clicking on the plus icon to the left of the column/measure name. This will show you, where exactly the artifact is used in the report. To expand all used objects with one click, use the expand button.
In this mode you can see that we do not only have artifacts from our dataset, but maybe also from our thin files since we could have report-level measures there. This cannot be deleted directly, since we only have the dataset open currently.
Additionally, these results can be displayed in more detail by selecting save results on the top left.
You can choose between two different Excel reports: save row by row report and save clustered report". In the row by row report, each use of an artifacts is displayed in one row. For example, if you the [Sales] column is used 8 times (e.g. in measures, calc. columns, visuals etc.), you will get 8 rows in the output. The "clustered" report, on the contrary, contains only one row for each artifact.
To only see the unused measures and columns, click on the unused button . Additionally, for a quick overview, you can bring up a bar chart under plot results in the menu on the top, showing the number of used and unused artifacts.
You can delete unused measures directly in Measure Killer, by clicking on kill measures and columns -> kill measures and selecting if you want to kill all unused measures, or if you want to select only specific measures to kill. Alternatively you can also generate a C# script.
Should you happen to delete an unused measure and later realize that you actually still need it, you can now restore measures by clicking on restore measures. You get a list of your previously deleted measures. This feature is currently still in preview so make sure to keep backups in case something goes wrong. It is important to understand that all deleted measures will be shown here (also from other reports).
For deleting unused columns, you have to select the option kill columns. A popup window appears, where you can choose whether you want to select the columns you want to delete (“Remove columns” syntax in PowerQuery), or whether you want to only keep the selected columns (“Remove other columns” syntax in PowerQuery). Now select the columns, click on apply and copy the M code. Now open the Advanced Editor of the respective table in Power Query and paste the copied M Code, replacing the existing code. You can see that now there is a new step in your transformation protocol.
The functionality of each button is explained in more detail further down in this document.
Shared/golden dataset online via XMLA
Requirements:
-
Basic or Enterprise version of Measure Killer
-
Premium Workspace (for Basic only PPU, Enterprise any Premium workspace is possible)
-
XMLA Endpoint activated with at least read permissions
-
XMLA Endpoint allowed in the Power BI Admin Portal
-
MSOLAP package installed
-
Access to all workspaces where connected reports should be searched for (you need at least contributor permissions in the workspace)
-
Reports that cannot be downloaded from the Power BI service cannot be analyzed by Measure Killer either (see Details -> Measure Killer compatibility -> ✗ Thin files for more information)
First, Measure Killer will trigger you to log in to your Microsoft Account to check if it can find a workspace in your native Power BI tenant. Then, select the workspace where the dataset to be analyzed is located in via the drop down above the top left window. Now, click on datasets next to the drop down menu. In the upper right window, select the correct dataset and click on connect. It will ask you to connect with your account again. Be aware that your dataset has to reside in a Premium capacity. We need to authenticate twice since now we are doing an XMLA connection which is different from the Power BI Rest API call we did initially.
Now we need to select all the workspaces where Measure Killer should search for connected reports. Please be aware of the number of Rest API calls (1x per workspace) in order to avoid hitting any tenant wide limits (e.g. if we do thousands of calls this might happen).
Click on reports in the lower right window. All reports are automatically selected for the analysis, which is visible in the last column called “Include this report”. In order to exclude one or more reports, select the one(s) to be excluded and press the “DEL” button on your keyboard. Now, in the last column it will show you that this report will not be included. Hit “Enter” to include a report that was previously excluded. Once your list is complete, click on run Measure Killer.
Measure Killer is now doing its magic. To show the user the progress and what is currently being done, a progress in percentages is displayed in the left window. Once this process has finished, click on show results.
The main table displays the results of the analysis. You will be able to see which artifacts are used, the size of the columns and other information like on which page of the report a measure is used or the type of visual it is used in. It is possible to expand each of the used columns and measures, by clicking on the plus icon to the left of the column/measure name. This will show you, where exactly the artifact is used in the report. To expand all used objects with one click, use the expand button.
In this mode you can see that we do not only have artifacts from our dataset, but maybe also from our thin files since we could have report-level measures there. This cannot be deleted directly, since we only have the dataset open currently.
Additionally, these results can be displayed in more detail by selecting save results on the top left.
You can choose between two different Excel reports: save row by row report and save clustered report". In the row by row report, each use of an artifacts is displayed in one row. For example, if you the [Sales] column is used 8 times (e.g. in measures, calc. columns, visuals etc.), you will get 8 rows in the output. The "clustered" report, on the contrary, contains only one row for each artifact.
To only see the unused measures and columns, click on the unused button . Additionally, for a quick overview, you can bring up a bar chart under plot results in the menu on the top, showing the number of used and unused artifacts.
You cannot delete unused measures directly in Measure Killer since we only read XMLA information. You can however generate a C# script.
Should you happen to delete an unused measure and later realize that you actually still need it, you can now restore measures by clicking on restore measures. You get a list of your previously deleted measures. This feature is currently still in preview so make sure to keep backups in case something goes wrong. It is important to understand that all deleted measures will be shown here (also from other reports).
For deleting unused columns, you have to select the option kill columns. A popup window appears, where you can choose whether you want to select the columns you want to delete (“Remove columns” syntax in PowerQuery), or whether you want to only keep the selected columns (“Remove other columns” syntax in PowerQuery). We cannot do this directly so please use the new M code in your preferred tool.
The functionality of each button is explained in more detail further down in this document.
Various buttons in the user interface explained
-
Back (icon - top left): Takes you to the previous page to select the mode of Measure Killer.
-
Refresh (icon - top left): Gets the latest ports of all opened .pbix files.
-
Copy text: Copies the text from the text box on the left.
-
Help (videos): Sends you to our YouTube channel.
-
Execute: Starts the analysis.
-
Feedback: Redirects you to a blog post on our website where we collect feedback for MK.
-
Plot unused vs. used: Plots the results graphically (not a nice chart, we know, sorry!)
-
Save results: Generates a detailed documentation as .xlsx file.
-
Kill unused measures: Allows you to either delete selected or all unused measures (see Features below for more information on this).
-
Kill unused columns: Opens a new window, where you can select all of the tables containing unused columns. These tables are sorted by the sum of storage space you can save in your model. It will generate an M code you can copy into the Advanced Editor of the respective table/query.
-
Reset: Resets the table to the default view.
-
Filter (in main window): Here you can filter by the Name/Table/Report columns in conjunction with the text field.
-
Clear table: Deletes the content of the table.
-
Restore measures (preview): Shows you which measures have been deleted and gives you the possibility to restore deleted measures (be careful since we can restore measures deleted in other reports as well - you basically get a full backup of all the measures you ever deleted in MK)