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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Wirz
Regular Visitor

Accessing Power BI data model programmatically

Hi,

 

I have to build an application that integrates Excel workbook models within Power BI and keep consistency with the reports made (I know you can import models from Excel to Power BI, but if any changes are made in Excel model, the model within Power BI becomes outdated). I need to properly refresh the Power BI model measures, relationships and M queries in the .PBIX file whenever an update is made within the Excel file I used to import the model.

 

Since Power BI does not support VBA scripts like Excel, I guess I have to use Microsoft Analysis Services API to have access to model and read the DAX code of its measures and (possibly) write new measures (at least, it seems that applications like DAX Studio do this in order to manipulate Power Pivot measures inside Power BI files).

 

However, I couldn't find any information regarding how to stablish connection with Power BI on the internet, neither I can understand what exactly DAX Studio does, looking at their code in GitHub. I'm not able to debug the applications here because I get some dependency errors.

 

How can I identify that an instance of analysis services is running and connect with Power BI application to access the data model in the .PBIX file?

1 REPLY 1
Seth_C_Bauer
Community Champion
Community Champion

@Wirz I don't think I completely follow what you are trying to do, but it certainly sounds like the piece you are missing here is the Power BI Service... After deploying a report, the gateway is the mechanism by which you can schedule refresh from the Excel files to the Power BI report... If you are some how trying to circumvent this entire process and trying to do this locally or in a different app, I'm not sure that would be possible.


Looking for more Power BI tips, tricks & tools? Check out PowerBI.tips the site I co-own with Mike Carlo. Also, if you are near SE WI? Join our PUG Milwaukee Brew City PUG

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.