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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PyDaxExtract-0.1.5.tar.gz.
File metadata
- Download URL: PyDaxExtract-0.1.5.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3761960ac2126e3b9a608d9813980d181a4f37b54ff3972c0e72e952594ee86c
|
|
| MD5 |
d78a2fec48f2c8d59b9792366e24d29d
|
|
| BLAKE2b-256 |
94804a8923c9ceef2380d94026d294ed30cc0158cc20f90d3375fb9f4901a37a
|
File details
Details for the file PyDaxExtract-0.1.5-py3-none-any.whl.
File metadata
- Download URL: PyDaxExtract-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bacfbf43918c3f39d54996d34b8b12041a08d0d31f0f1e1d4861d3fb2d86454
|
|
| MD5 |
d777ac53fb9b7202d1ceff76e68477cf
|
|
| BLAKE2b-256 |
7c9880816fa2ebdf17bb0664c5d6ebe9f70a4e4c202f27976472234a89cede86
|