Forum Discussion
Programmatically set data colors by unzipping .pbix and modifying Layout.file
- 9 years ago
If I open the pbix file with 7-Zip, open the Layout file with Notepad++, change the color and save the Layout file to local drive then replace the original one in 7-Zip, I will got the same error message as you when open the changed pbix file.
But if I copy this changed pbix file to another machine which installs the same version of Power BI Desktop, the file can be opened properly and the color has changed properly.
So you can try to modify the layout file in one machine, but do not open this file with the same machine. I’m not sure why but you can have a try. For how to use 7-Zip and Notepad++, please refer to this article.
Best Regards,
Herbert
If I open the pbix file with 7-Zip, open the Layout file with Notepad++, change the color and save the Layout file to local drive then replace the original one in 7-Zip, I will got the same error message as you when open the changed pbix file.
But if I copy this changed pbix file to another machine which installs the same version of Power BI Desktop, the file can be opened properly and the color has changed properly.
So you can try to modify the layout file in one machine, but do not open this file with the same machine. I’m not sure why but you can have a try. For how to use 7-Zip and Notepad++, please refer to this article.
Best Regards,
Herbert
- tpankake8 years agoNew Member
With regard to copying the file to another machine to work arond the corrupted file message, another way to get around the message is to open the file in 7-zip and delete the SecurityBindings file. There must be a checksum associated with the current machine in the security bindings file. After deleting the file, Power BI opens it without complaining, and then modifying in Power BI will restore the bindings.
Also be sure to use Notepad++ as your editor for 7-zip...or at least be sure NOT to use Windows Notepad. Windows Notepad adds an invisible byte order marker at the start of the document (0xfffe for little endian text files) which also triggers a corruption message in Power BI.
- Anonymous7 years agoNot applicable
Has anyone been able to go in and modify the datamashup file? I was wanting to replicate all the fomulas in the DataMashup\Formulas\Section1.m into a new pbix file, but keep getting the corrupt message
- Anonymous7 years agoNot applicable
Make sure to zip the contents of the unzipped directory not the directory itself.
- marcopol3 years agoAdvocate I
Thank you! It worked for me. Definitely you need to use 7zip, notepad++ and delete the security binding file.