Skip to content

PBIR Utils

pbir-utils is a Python library designed to streamline the tasks that Power BI developers typically handle manually in Power BI Desktop. This module offers a range of utility functions to efficiently manage and manipulate PBIR (Power BI Enhanced Report Format) metadata.

โœจ Features

Core Utilities

  • ๐ŸŒ Web UI: Interactive browser-based interface for reports, wireframes, and actions
  • ๐Ÿ“„ Extract Metadata: Export metadata from PBIR files to CSV
  • ๐Ÿ–ผ๏ธ Wireframe Visualizer: Visual report layout with zoom, search, and field tracking
  • โœ… Validate Report: Rule-based validation with custom expression support
  • ๐Ÿงน Sanitize Report: Clean up and optimize reports with YAML configuration

Report Management

  • โ›” Disable Interactions: Bulk disable interactions between visuals
  • ๐Ÿงผ Remove Measures: Remove unused report-level measures
  • ๐Ÿ”— Measure Dependencies: Extract measure dependency trees
  • ๐Ÿ”– Remove Unused Bookmarks: Clean up orphaned bookmarks
  • ๐ŸŽจ Remove Unused Visuals: Remove unused custom visual registrations

Filters & Pages

  • ๐Ÿ” Update Filters: Modify report-level filter conditions
  • ๐Ÿ”ข Sort Filters: Reorder filter pane items
  • โš™๏ธ Configure Filter Pane: Control pane visibility and state
  • ๐Ÿ“ Set Page Size: Set page dimensions for all pages
  • ๐Ÿ™ˆ Hide Tooltip Pages: Auto-hide tooltip and drillthrough pages

๐Ÿ“ฆ Installation

# Using uv (Recommended)
uv add pbir-utils

# Using pip
pip install pbir-utils

For the web UI, install with optional dependencies:

# Using uv
uv add "pbir-utils[ui]"

# Using pip
pip install "pbir-utils[ui]"

๐Ÿš€ Quick Start

After installation, the pbir-utils CLI is available:

# Launch interactive web UI
pbir-utils ui

# Sanitize a report with default actions (dry-run to preview)
pbir-utils sanitize "C:\Reports\MyReport.Report" --dry-run

# Validate against best practices
pbir-utils validate "C:\Reports\MyReport.Report"

# Extract metadata to CSV
pbir-utils extract-metadata "C:\Reports\MyReport.Report"

# Visualize report wireframes
pbir-utils visualize "C:\Reports\MyReport.Report"

Or use the Python API:

import pbir_utils as pbir

# Validate a report
result = pbir.validate_report(r"C:\Reports\MyReport.Report", strict=False)
print(result)  # "5 passed, 0 errors, 2 warnings"

# Sanitize a report
pbir.sanitize_powerbi_report(r"C:\Reports\MyReport.Report", dry_run=True)

๐Ÿ“š Next Steps