__pycache__ | ||
MSNET | ||
static | ||
templates | ||
.gitattributes | ||
app.py | ||
dax_parser.py | ||
LICENSE | ||
model_connector.py | ||
README.md | ||
requirements.txt |
Power BI Measure Call Graph
A Flask web application that visualizes the dependency relationships between measures in a Power BI / Analysis Services model.
Features
- Connect to Analysis Services models
- Extract measures and their DAX expressions
- Parse DAX expressions to determine dependencies between measures
- Visualize the call graph with an interactive D3.js visualization
- Search for specific measures
- Click on measures to highlight dependencies
- Hover over measures to see their DAX expressions
Requirements
- Python 3.7+
- Microsoft Analysis Services ODBC driver (MSOLAP)
- Access to a Power BI / Analysis Services model
Installation
-
Clone this repository:
git clone https://git.chenwuzhu.cn/chenwu/PBI-Measure-CallGraph.git cd pbi-measure-callgraph
-
Create a virtual environment (optional but recommended):
python -m venv venv venv\Scripts\activate # Windows source venv/bin/activate # macOS/Linux
-
Install the required packages:
pip install -r requirements.txt
Usage
-
Start the Flask application:
python app.py
-
Open your web browser and navigate to:
http://localhost:5000
-
Enter your Analysis Services server and database information and click "Connect"
-
Once connected, the call graph will be displayed with all measures from your model
-
Interact with the graph:
- Click on a measure to highlight its dependencies
- Hover over a measure to see its DAX expression
- Use the search box to find specific measures
- Use the mouse wheel to zoom in/out
- Drag the graph to pan
- Click the "Reset View" button to center the graph
How It Works
- Connection: The application connects to your Analysis Services model using the MSOLAP ODBC driver
- Measure Extraction: It retrieves all visible measures and their DAX expressions
- Dependency Analysis: The DAX parser analyzes each expression to identify references to other measures
- Visualization: The D3.js force-directed graph visualizes the dependencies between measures
Troubleshooting
- Connection Issues: Ensure you have the MSOLAP driver installed and that you have access to the specified server and database
- Missing Measures: Only visible measures are included in the graph
- Incorrect Dependencies: The DAX parser uses a simplified approach to identify measure references and may not catch all complex scenarios
License
MIT