Skip to main content

Extract DAX expressions from Power BI template.

Project description

PyDaxExtract

Export DAX formulas from a Power BI template file.

Power BI files in the pbix and pbit formats are basically zip archives containing other compressed data.

The DataModel file in a pbix file contains all the DAX formulas created when processing data. Formulas are saved in the Xpress9 format, which is a proprietary compresson method optimized to dump memory to disk and vice-versa, with encryption and all kinds of other wonderful features which will break you heart if you try to get a peek inside.

Fortunately, if one saves a Power BI workbook as a template, the DAX formulas are now saved in the DataModelSchema object, which is unencrypted and requires only a bit of fiddling to remove.

This script is intended to help with that fiddling, and to aid users in serializing work done in an otherwise fairly opaque binary format. Here's hoping it's useful to you.

At this point, there appears to be no way to automate exporting pbix files as pbit, so you'll have to do that the usual way.

This script will work as long as it does, given the rate of churn (I mean development) in Power BI. Good luck!

Usage

daxextract.py --help
usage: daxextract.py [-h] pbit_path [csv_path]

Extract DAX Formulas from DataModelSchema in Power BI template (.pbit) file.

positional arguments:
  pbit_path   Path to .pbit file.
  csv_path    Path to write DAX expressions and metadata in csv format. If
              this argument is not specified, formulas will be written to
              STDOUT

optional arguments:
  -h, --help  show this help message and exit

Installation

pip install pydaxextract

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

PyDaxExtract-0.1.5.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

PyDaxExtract-0.1.5-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

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