Skip to main content

Audit DAX measures in a Power BI PBIP project

Project description

pbi-audit

Audit every DAX measure in your Power BI project — find what's unused, what's a helper, and what's actually powering your visuals.

PyPI version Python 3.9+ License: MIT


Prerequisite — save your report as a PBIP project

pbi-audit reads the open file format that Power BI Desktop writes when you save as a PBIP project (as opposed to the legacy .pbix binary).

To enable it:

  1. Open Power BI Desktop
  2. Go to File → Options → Preview features
  3. Enable Power BI Project (.pbip)
  4. Save your report: File → Save as and choose the .pbip format

This produces a folder structure that pbi-audit can read. .pbix files are not supported.


What it does

Power BI projects accumulate measures over time. pbi-audit scans your PBIP project and classifies every single measure:

Status Meaning
UNUSED Not referenced anywhere — safe to delete
USED (DAX only) Only called by other measures — a helper
USED (Visual only) Directly driving a visual on a report page
USED (Visual + DAX) Used in both visuals and other measures

It then generates an HTML report and/or an Excel workbook so you can review, filter, and act.


Quick start

pip install pbi-audit
pbi-audit

That's it. A guided wizard walks you through the rest.


Demo

Wizard walkthrough (text preview):

╔══════════════════════════════════════════════════════╗
║  pbi-audit  v0.1.0                                   ║
║                                                      ║
║  Audit DAX measures in a Power BI PBIP project.      ║
║  Scans your semantic model and report pages to       ║
║  classify every measure as:                          ║
║                                                      ║
║    UNUSED          — safe to delete                  ║
║    USED (DAX only) — helper/intermediate measure     ║
║    USED (Visual)   — directly used in a report       ║
║    USED (Both)     — used in visuals and DAX         ║
║                                                      ║
║  Outputs an HTML and/or Excel report.                ║
╚══════════════════════════════════════════════════════╝

  Step 1/3 — PBIP Project Folder
  ────────────────────────────────────────────────────
  Type a path, or press Enter to open the folder browser:

  > C:\Projects\Store Sales

  ✓ Folder: C:\Projects\Store Sales

  Step 2/3 — Output Folder
  ────────────────────────────────────────────────────
  Where should reports be saved?
  Press Enter to save in the PBIP folder, type a path, or type "o" to browse:

  > 

  ✓ Output: C:\Projects\Store Sales

  Step 3/3 — Report Format
  ────────────────────────────────────────────────────
  [1] HTML + Excel  (default)
  [2] HTML only
  [3] Excel only

  > 1

  ✓ Format: both

  Running audit
  ────────────────────────────────────────────────────
  ✓ 42 measures found
  ✓ 18 measures referenced in visuals
  ✓ Usage status computed

  Results
  ────────────────────────────────────────────────────
    UNUSED          11
    USED (DAX only)  8
    USED (Visual)    9
    USED (Both)     14
    ────────────────
    Total           42

  Saving reports
  ────────────────────────────────────────────────────
  ✓ HTML  → C:\Projects\Store Sales\DAX_Measures_Audit.html
  ✓ Excel → C:\Projects\Store Sales\DAX_Measures_Audit.xlsx

  Done! Open the report(s) above to explore your measures.

Report preview

HTML report preview

Run pbi-audit against your project to generate the interactive HTML report — filter by status, search by measure name, and hover any formula to see the full DAX expression.


Installation

Requires Python 3.9 or later.

pip install pbi-audit

Usage

Guided wizard (recommended)

Run with no arguments — a step-by-step wizard will prompt for your PBIP folder, output location, and report format:

pbi-audit

Direct path

pbi-audit "C:\path\to\your_project.pbip"

Options

Argument Short Description Default
path Path to the PBIP project root opens wizard
--output -o Where to save the reports same as input
--format -f html, excel, or both both

Examples

# Audit a specific project, HTML report only
pbi-audit "C:\Projects\Sales.pbip" --format html

# Save reports to a separate folder
pbi-audit "C:\Projects\Sales.pbip" -o "C:\Reports"

Output

Two files are written to the output folder:

DAX_Measures_Audit.html Interactive table with status filters, table filter, and search. Hover any formula cell to see the full DAX expression.

DAX_Measures_Audit.xlsx Excel workbook with a Summary sheet (counts by status) and a Measures sheet with full detail, auto-filter, and frozen header.


Expected project structure

pbi-audit works with the standard PBIP layout produced by Power BI Desktop:

my_project/
├── my_project.SemanticModel/
│   └── definition/
│       └── tables/
│           └── *.tmdl
└── my_project.Report/
    └── definition/
        └── pages/
            └── */
                ├── page.json
                └── visuals/
                    └── */
                        └── visual.json

Contributing

Bug reports and feature requests are welcome — open an issue on GitHub.


License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pbi_audit-0.1.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pbi_audit-0.1.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file pbi_audit-0.1.0.tar.gz.

File metadata

  • Download URL: pbi_audit-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pbi_audit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2568606d459c7c87ff8babf84df261019e9966f1ec724ab9bcae6f2c2c248fe7
MD5 4bb8052d09c3a1f28f8e7c9931ac1b9e
BLAKE2b-256 0d79150399d0e7124740db2cac406b00c5660147b67ddfa9175a77f5417c1b07

See more details on using hashes here.

File details

Details for the file pbi_audit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pbi_audit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pbi_audit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d383c909e69e814f9351f623f3830f5362ca8e028f28174cf45544b0c47e047
MD5 a0b7dfdf29ac16d5d6df33df29a2d763
BLAKE2b-256 3c670a7240cf3c2be21889033206d3b67569c6b7b7f089b739125e7f9835ee6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page