Forum Discussion
How to Trace Power BI Measure Dependencies with C# or Python
Problem Statement
- A large number of DAX measures exist within a Power BI file, many of which appear unused, but cannot be deleted due to uncertainty around hidden dependencies.
- Measures cannot be safely modified, as they might be referenced in visuals or by other measures—leading to potential disruptions in the reporting logic.
- There is currently no automated way to trace how and where measures are referenced—either directly or indirectly—in other measures or visuals.
I’m planning to develop a standalone application using either C# or Python that connects to the Power BI API service. The application should perform necessary data extraction and transformations—such as analyzing DAX measure dependencies and usage across visuals—and output the results into a structured CSV file for further analysis.
I’d appreciate expert guidance on:
- The best approach for building this application
- Recommended frameworks and libraries for Power BI integration
- How to efficiently transform and organize the data
- Any best practices or pitfalls to avoid during development"
Sort of. You can use the REST API for the inventory of the semantic models. but then you need to use XMLA endpoints and run DMV queries (or use the INFO.* DAX functions) against each semantic model individually.
6 Replies
- lbendlinSuper User
Have you considered using tools that are already available, like MeasureKiller by Georg Brunner?
Problem Statement A large number of DAX measures exist within a Power BI file, many of which appear unused, but cannot be deleted due to uncertainty around hidden dependencies.A measure only incurs cost when it is used. An unused measure may impact maintainability but has no impact on system performance.
- mantukumarNew Member
Thank lbendlin but can we create our own using Power BI API services?
- lbendlinSuper User
Sort of. You can use the REST API for the inventory of the semantic models. but then you need to use XMLA endpoints and run DMV queries (or use the INFO.* DAX functions) against each semantic model individually.
- v-priyankataCommunity Support
Hi mantukumar
I hope the information provided by lbendlin was helpful. If you still have questions, please don't hesitate to reach out to the community.
- v-priyankataCommunity Support
Hi mantukumar
I wanted to check if you had the opportunity to review the information provided by user. Please feel free to contact us if you have any further questions.
- v-priyankataCommunity Support
Hi mantukumar
Hope everything’s going smoothly on your end. We haven’t heard back from you, so I wanted to check if the issue got sorted. if you have any other issues please reach community.