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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
kamaldeepgurhan
Regular Visitor

Creating PowerBI Reports Programmatically Using TOM or BI Service APIs

We have created the semantic model via TOM in BI service and used gateway to attach/refresh the data. Now need to create the dashboards/visuals/reports from the model. One way to create it manually or we can use scripts to simulate a user interaction with a web page the manual work but it is not an optimize approach.

Please could you suggest how to create .pbix file Or now .pbib file from the code.

It would be great to have some guidance with example

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @kamaldeepgurhan ,
Thank you for your further questions.
Based on the idea of .PBIP files and reverse engineering that you mentioned, .PBIP files are currently a new file format for Power BI projects that provides a way to save reports and semantic models in a separate folder structure designed for version control and collaborative development. PBIP files allow you to integrate a Power BI project with a version control system such as Git, where you can independently manage and modify the semantic model and report files (such as .pbir), which is useful for development teams.

Git integration with Power BI Desktop projects - Power BI | Microsoft Learn
However, reassembling the .PBIP folder structure into .PBIX files still needs to be done through Power BI Desktop. Currently, Power BI Desktop provides the ability to save such projects, but it is not fully automated and the save operation must be performed in Power BI Desktop. While you can build the .PBIP folder structure manually or through scripting, to generate the .PBIX file, you still need to use Power BI Desktop.

vxingshenmsft_0-1729573763504.png

Power BI Desktop projects (PBIP) - Power BI | Microsoft Learn

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

5 REPLIES 5
bjlay20001
New Member

Please vote on this idea

kamaldeepgurhan
Regular Visitor

Hi @Anonymous  I agree with you that with APIs its not possible as of now. 

Just consider this scenario, I have saved as .PBIX file as .PBIP file type to get the folder structure which contains .Report, .SemanticModel , a .PBIP file and a git reference.

Now, just thinking to perform the reverse engineering and trying to create this folder structure to get get the .PBIX file. 

Please suggest, if this looks possible OR what do you think the challanges I can face. 

Anonymous
Not applicable

Hi @kamaldeepgurhan ,
Thank you for your further questions.
Based on the idea of .PBIP files and reverse engineering that you mentioned, .PBIP files are currently a new file format for Power BI projects that provides a way to save reports and semantic models in a separate folder structure designed for version control and collaborative development. PBIP files allow you to integrate a Power BI project with a version control system such as Git, where you can independently manage and modify the semantic model and report files (such as .pbir), which is useful for development teams.

Git integration with Power BI Desktop projects - Power BI | Microsoft Learn
However, reassembling the .PBIP folder structure into .PBIX files still needs to be done through Power BI Desktop. Currently, Power BI Desktop provides the ability to save such projects, but it is not fully automated and the save operation must be performed in Power BI Desktop. While you can build the .PBIP folder structure manually or through scripting, to generate the .PBIX file, you still need to use Power BI Desktop.

vxingshenmsft_0-1729573763504.png

Power BI Desktop projects (PBIP) - Power BI | Microsoft Learn

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Jonvoge
Super User
Super User

Hi kamaldeepgurhan

 

You might be able to do this using some of the Report Authoring API options for Power BI embedded: Report authoring overview in Power BI embedded analytics | Microsoft Learn

I am however not an expert on this topic. Perhaps the documentation can guide you in the correct direction.

_____________________________________________________
I hope my comment was helpful.
If your question was answered, please mark your post as 'Solved' and consider giving me a 'Thumbs Up'.
Find me on LinkedIn, Sessionize, or my blog Downhill Data

Anonymous
Not applicable

Hi @kamaldeepgurhan ,

Hello, thank you for your question! Currently, the Power BI REST API does not support the creation of new .pbix report files directly through code.The API is mainly used for managing existing reports (e.g. uploading .pbix files, cloning reports, modifying datasets, etc.).You can design reports in Power BI Desktop and then automatically upload and publish the report using the Power BI REST API file using the Power BI REST API. You can refer to the related API call documentation I found for you, hope it can help you solve the problem, if you have further questions or need more help, please feel free to let me know!

vxingshenmsft_0-1729230222100.png

Reports - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Hope it helps!

Best regards,
Community Support Team_ Tom Shen

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

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.