Forum Discussion
Conditional Data Color Formatting Bar by field values
- 4 years ago
Hi, DouglasBrito
Thanks for the explanation.
What you want to do is to keep the color of the data bars constant in all cases.The inelegant way to do this is to manually adjust the color of each visual data bar.
You can also import a custom theme to do this. With custom themes you can customize the color of multiple visual data bars at the same time.
By default, the visuals have their own color groups. If you find inconsistent data bar colors on multiple visuals, it may be that the default colors of different visuals do not match. Or a different theme was applied.Refer to this document to learn more about custom report themes
Use report themes in Power BI Desktop
You can also make further adjustments to the theme you just imported on your desktop after importing it.
Here is website to help you quickly generate json files for custom themes.
https://themes.powerbi.tips/properties
I provide a sample theme below, you can modify it or generate a new theme yourself.
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-angzheng-msft
Thanks for your reply and analysis.
I've added the pbi file by the link below.
I need to show fish qty throughout years, I can have multiple species grouped on each year, which is working fine. The problem is, once I choose assign to the Legend the fish id Power automatically assigns a color for each specie.
When it is published these color can change, as PBI service doesn't preserve the desktop color.
The user problem is that he needs to compare fish qty across multiple sites/years. So if fish 1 has the color dark blue, for example, he needs that whenever sites he choose the color is kept. This maybe work fine for the same PBI service session, but if you open a new browser or come back tomorrow to continue your analysis, the fish 1 represented as dark blue can now be displayed as dark orange.
So I need to keep the fish color assigned to each fish id immutable. So that id has always the same color.
To do that I cannot just drag the fish id to the Legend, I need to use a conditional formatting based on DAX, which work fine if I have only one specie chosen, once I choose more than one specie it doesn't work, as DAX return just one hex color code.
I hope I have made it a bit clear.
Thanks,
https://drive.google.com/file/d/1bN2dJYay7nkpiAxi6xRi5EHVg2wiLVev/view?usp=sharing