Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mantukumar
New Member

How to Trace Power BI Measure Dependencies with C# or Python

Problem Statement

  1. 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.
  2. Measures cannot be safely modified, as they might be referenced in visuals or by other measures—leading to potential disruptions in the reporting logic.
  3. 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"
4 REPLIES 4
v-priyankata
Community Support
Community 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.

 

lbendlin
Super User
Super 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.

Thank lbendlin but can we create our own using Power BI API services?

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.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.