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 you are wanting to do this to keep consistency of legend colours between visuals then there is much easier, and quicker, process which can be followed here: https://community.powerbi.com/t5/Desktop/Color-Linking/td-p/221636