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 September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors