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 August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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