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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
FelipeGualberto
Frequent Visitor

Create Power BI Reports programatically

Is it possible to create queries, relationships, measures and visuals programatically in PBI Desktop through code, and/or modify/create a PBIX file?
I'm trying to parametrize the creation process of PBIX files.

1 ACCEPTED SOLUTION
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @FelipeGualberto,

 

I would suggest you create an idea here.

 

Best Regards,

Dale

Community Support Team _ Dale
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

6 REPLIES 6
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @FelipeGualberto,

 

I would suggest you create an idea here.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the confirmation, I'll create.

az2451
Resolver I
Resolver I

You can not even print reports in Power BI, so what do you expect?

Just kidding 🙂 but it is planned for the next updates

 

Back to the topic: I tried to modify the PBIX by unpacking it and reading the code. But you can't decently work with this anymore.

 

For e.g. if i convert a custom visual into a PBIX file (the project folder involves typescript, json, less code etc.) the code will change completely.

Every variable/function has a letter now and all comments are gone, it is just bad to work with and hard to understand the code.

 

So after creating a PBIX package is not possible the retrieve the source code in good shape or make it undone because the process of the packaging simplifies the code which is not irreversibel.

 

 

This means: you can not modify the PBIX but you can create one by using Power BI CLI. I would suggest to take a look in custom visuals. It is actually possible in there to create queries, relationships, measures and visuals.

 

Here is a great tutorial for the beginning: https://tsmatz.wordpress.com/2016/09/27/power-bi-custom-visuals-programming/

 

 

Greetings,

Berat

 

I simply unpacked the PBIX file, changed the timestamp of a file by saving, packed it again and the PBIX didn't open anymore.

That is developer proof.

Maybe it has a good reason so no one can easily read the source code 🙂

 

#Copyright

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.