Skip to main content

A tool for managing Power BI Enhanced Report Format (PBIR) projects

Project description

PBIR Utilities

pbir-utils is a python project 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 metadata.

Features

  • CLI Support: Access all utilities directly from the command line.
  • Extract Metadata: Retrieve key metadata informations from PBIR files.
  • Update Metadata: Apply updates to metadata within PBIR files.
  • Report Wireframe Visualizer: Visualize PBIR report wireframe.
  • Disable Visual Interactions: Bulk disable interactions in PBIR report.
  • Remove Measures: Bulk remove report-level measures.
  • Get Measure Dependencies: Extract the dependency tree for report-level measures.
  • Update Report Level Filters: Update the filters added to the Power BI report level filter pane.
  • Sort Report Level Filters: Reorder filters in report filter pane on a specified sorting strategy.
  • Standardize Folder Names: Standardize page and visual folder names to be descriptive.
  • Sanitize Power BI Report: Clean up and optimize Power BI reports.

Installation

pip install pbir-utils

CLI Usage

The pbir-utils command is available after installation.

1. Sanitize Report

Sanitize a Power BI report by removing unused or unwanted components.

pbir-utils sanitize "C:\Reports\MyReport.Report" --actions remove_unused_measures cleanup_invalid_bookmarks --dry-run
pbir-utils sanitize "C:\Reports\MyReport.Report" --actions all

2. Extract Metadata

Export attribute metadata from PBIR to CSV.

pbir-utils extract-metadata "C:\Reports\MyReport.Report" "C:\Output\metadata.csv"

3. Visualize Wireframes

Display report wireframes using Dash and Plotly.

pbir-utils visualize "C:\Reports\MyReport.Report"
pbir-utils visualize "C:\Reports\MyReport.Report" --pages "Overview" "Detail"

4. Batch Update

Batch update attributes in PBIR project using a mapping CSV.

pbir-utils batch-update "C:\PBIR\Project" "C:\Mapping.csv" --dry-run

5. Disable Interactions

Disable visual interactions between visuals.

pbir-utils disable-interactions "C:\Reports\MyReport.Report" --dry-run
pbir-utils disable-interactions "C:\Reports\MyReport.Report" --pages "Overview" --source-visual-types slicer

6. Remove Measures

Remove report-level measures.

pbir-utils remove-measures "C:\Reports\MyReport.Report" --dry-run
pbir-utils remove-measures "C:\Reports\MyReport.Report" --measure-names "Measure1" "Measure2"

7. Measure Dependencies

Generate a dependency tree for measures.

pbir-utils measure-dependencies "C:\Reports\MyReport.Report"

8. Update Filters

Update report-level filters.

pbir-utils update-filters "C:\Reports" '[{"Table": "Sales", "Column": "Region", "Condition": "In", "Values": ["North", "South"]}]' --dry-run

9. Sort Filters

Sort report-level filter pane items.

pbir-utils sort-filters "C:\Reports" --sort-order Ascending --dry-run
pbir-utils sort-filters "C:\Reports" --sort-order Custom --custom-order "Region" "Date"

Python API Usage

You can also use the library in your Python scripts:

import pbir_utils as pbir

# Example: Sanitize a report
pbir.sanitize_powerbi_report("C:\\Reports\\MyReport.Report", actions=["remove_unused_measures"])

To get started, refer to example_usage.ipynb notebook, which contains detailed examples demonstrating how to use the various functions available in pbir_utils.

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

pbir_utils-1.1.4.tar.gz (56.6 kB view details)

Uploaded Source

Built Distribution

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

pbir_utils-1.1.4-py3-none-any.whl (37.8 kB view details)

Uploaded Python 3

File details

Details for the file pbir_utils-1.1.4.tar.gz.

File metadata

  • Download URL: pbir_utils-1.1.4.tar.gz
  • Upload date:
  • Size: 56.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pbir_utils-1.1.4.tar.gz
Algorithm Hash digest
SHA256 8c482bafc3a9631e3f823d360fd594cb187c2c5d8c81cbc930930c6246417396
MD5 534d01a6e51dfa116edc04e4a5324577
BLAKE2b-256 3d870ed5fdbc923e531dda56d7138b17b01d49cc9eda36d9ed8ce44868c9b521

See more details on using hashes here.

File details

Details for the file pbir_utils-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: pbir_utils-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 37.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for pbir_utils-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 28e12e592e5a1383d6a9abfc9755973ceda6d53ab82d35ce887ab7e60192fc31
MD5 643c389b7ff8bc2c1568244f7746ef82
BLAKE2b-256 192efcc90ab83db61f3a0cb6e177ee1da0cf65a35390b03ad00b29482834cad6

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