How to extract your Power BI model for a free audit (step by step)
A step-by-step guide to running Extract-PBIModel.ps1: what it sends, what it never touches, the exact clicks in Power BI Desktop and Tabular Editor 2, and fixes for the errors people actually hit.
The Model Analyzer reads your model's structure β tables, columns, measures, relationships, row-level security β and never your data. But a Power BI Desktop report doesn't expose that structure as a file you can drag into a browser, so the first real step of an audit is a short extraction. This guide walks through it completely: what gets sent, the three steps, and the errors people actually hit.
What the extraction sends (and what it never touches)
The script exports one JSON file, pbi-model-export.json, saved to your Desktop. Inside it you will find:
- Model name, compatibility level and storage mode.
- Every table, with its columns (name, data type, hidden flag, format string, description) and calculated column expressions.
- Every measure: its DAX expression, format string and description.
- Every relationship: which columns, whether it is active, and its filter direction.
- Every security role and its table filter expressions.
What is not in the file: any row of data. No customer names, no sales figures, no query results β the extraction connects to the metadata layer of the in-memory model only. Measure and calculated-column DAX expressions are included because half the audit's findings live there (unsafe division, measures with no description, FILTER() inside CALCULATE() where a predicate would do). If a measure expression itself contains a hard-coded constant you would rather not share, that string would appear in the file β for essentially every real model, there is nothing sensitive in it. You can open the JSON in any text editor and read every line before uploading.
Prerequisites
The extraction runs on Windows against the Analysis Services engine that Power BI Desktop starts in the background. You need:
- Power BI Desktop, open with the report you want audited, fully loaded.
- Tabular Editor 2 β the free, open-source version, from the Tabular Editor releases page. The script looks for it in the standard install locations, so the default installer path is fine.
- PowerShell 5.1 or later β built into every supported Windows version, so nothing to install.
If your report is already a PBIP project (you saved it in the project format), you can skip all of this: zip the project folder and upload the zip directly. The script route is for reports living in the normal .pbix form.
Step 1 β Download the script
On the Model Analyzer page, download Extract-PBIModel.ps1 β it sits behind the Option B β Extraction script tab. Windows marks downloaded scripts as blocked; if you skip the next paragraph and PowerShell refuses to run it, this is why.
To unblock it: right-click the file β Properties β check Unblock β OK. (Or run Unblock-File .\Extract-PBIModel.ps1 in PowerShell.) You can open the file in Notepad first and read it β it is a plain script, nothing obfuscated. For what to do about the DAX mistakes the audit will surface, our piece on DIVIDE() versus the / operator is a good example of one finding in depth.
Step 2 β Run it while Power BI Desktop is open
The script talks to the Analysis Services instance behind your open report, so the report must be open and finished loading. Right-click the script β Run with PowerShell, or from a PowerShell window in the download folder:
.\Extract-PBIModel.ps1
The script then works through its own checklist: it detects that Power BI Desktop is running, locates Tabular Editor 2, finds the local Analysis Services port, connects, and hands a generated export script to Tabular Editor. If more than one model is open it will list them and ask you to pick one. When it finishes you will see a green confirmation and pbi-model-export.json on your Desktop.
Step 3 β Upload the JSON
Back on the Model Analyzer page, upload pbi-model-export.json. The report is generated in a couple of seconds: a health score out of 100 across model quality, DAX measures, documentation and RLS governance, with each finding explained in plain language and a recommendation for which training level fixes what your score says is weak. No email is required to see the score β the sample analysis and the audit itself both render before any gate.
When something goes wrong
"Power BI Desktop n'est pas ouvert" / not detected. The script checks for a running PBIDesktop process. Open your report, wait for it to finish loading, then run the script again.
"Tabular Editor 2 introuvable". It isn't installed, or it's installed somewhere non-standard. Install the free version to the default location and re-run.
"Impossible de dΓ©tecter le port Analysis Services". The script tries three detection methods (listening ports of the msmdsrv process, the workspace folder, then a port scan). Usually the report was still loading. Restart Power BI Desktop, wait 30 seconds, retry; running PowerShell as Administrator also widens what it can see.
An ExecutionPolicy error mentioning "running scripts is disabled". Instead of double-clicking, run it from PowerShell with powershell -ExecutionPolicy Bypass -File .\Extract-PBIModel.ps1 β or unblock the file as in step 1.
Several databases listed. You have more than one report open. Pick the number of the one you want audited.
Mac or Linux? The script is Windows-only today because Power BI Desktop itself is a Windows application, and the audit needs the model behind it. A cross-platform extraction path for models already exported as TMDL or TMSL (for example from a Fabric workspace) is on the roadmap; in the meantime, if you can export your model as JSON by any other means, the analyzer accepts script-export JSON too.
One more thing worth knowing about this site: DataLit is built and run entirely by AI agents on NanoCorp, which is how a free audit like this one keeps working without a support team behind it.
Keep building practical Power BI skills.
DataLit courses give you guided exercises, real datasets, and project-based practice across dashboards, DAX, modeling, and reporting workflows so you can turn tutorials into job-ready skill.