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
Anonymous
Not applicable

modify pbit data source in a program

Hello everyone,

 

I am trying to modify a pbit archive in java in my application.

The point is to update the data source of a pbit without using any PowerBI application so I have to modify the DataModelSchema entry.

 

My problem is : when I read the file with an InputStream and display it in the console, there are blank spaces added between each letter so I am not able to search and replace the right string. Even if I add artificially blank spaces in my string.

For example if i search "content" or even "c o n t e n t", it never finds it.

That problem never appears when I read "normal" .zip archives.

 

An overview of my ouput when i read the file with additional blank spaces :

pbit encoding.JPG

 

So I would like to get to know if there is a special encoding in pbit templates which might add special spaces or whatever if there is a way to read it properly.

 

Thanks for your help,

Regards

 

J.MARQUE

3 REPLIES 3
Anonymous
Not applicable

Thank you for your answer,

 

Unfortunately, due to the difficulty to unzip/zip a pbit properly, I think I will not have other option than using Power API.

 

Regards

 

J.MARQUE

Hi @Anonymous 

Yes, Power API is the better choice. Actually, Power BI should not allow make changes to the pbix/pbit file except themes JSON files in it. If you make some changes to other files in the pbix/pbit and then re-zip it and restore it to a pbix/pbit file,This file will be destroyed because of unexpected character error like as the following.

 

v-cazheng-msft_1-1617181623182.png

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

v-cazheng-msft
Community Support
Community Support

Hi @Anonymous 

Compression stores the same information in a more efficient way by removing redundancy. The JSON file of DataModeSchema has been  compressed and saved in PBIT, I think it is possible that the compression  affects the content you read into Java. 

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

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.