Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
I have a custom theme that defines 14+ theme colors, where my visuals need to access color index values 2-13. Is there a way to directly reference these records in my theme's color pallet?
When I overwrite report.json to use {\"ThemeDataColor\":{\"ColorId\":10,\"Percent\":0}} ... {\"ThemeDataColor\":{\"ColorId\":13,\"Percent\":0}} then PowerBI ignores the color formatting that I've defined and starts recycling index values 2, 3, 4, and 5 again.
Is it possible to refer to template colors that aren't visible in desktop application's visible pallet without overwriting each visual with the color's actual HEX values?
Hi, @CleverBadger
From what I understand, Power BI itself does not support direct referencing of subject colours by index value (e.g. what you said #11+). Even if this were supported, consider that when sharing a report with others, the colours are not visible to others (your colour text is local), and using hex codes ensures that everyone sees the same colours regardless of their Power BI settings. And if this feature what you describe is important to your work, you can submit an idea for here and the product team will take note of such a need.
Related Link: New tab (powerbi.com)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @v-yaningy-msft ,
Respectfully, PowerBI references colors by index value as defined by the theme's color pallet - that is one of the purposes of using stylesheets and themes. The index is 0-based, so the first color has a value of 0, the 10th color has a value of 9. All I was trying to do was eliminate the explicit hex codes from the report.json file and have everything referencing the stylesheet (this is the behavior that the desktop application performs when the top row of colors is selected from the GUI's color pallet. White=0, Black=1, Theme color 1 = 2, ..., Theme color 8 = 9. It's not until someone uses the 'More colors' selection where the desktop application encodes the hex values directly into report.json)
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#set-theme-colors
and
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-report-themes#set-theme-colors
Kind regards,
CleverBadger
User | Count |
---|---|
120 | |
69 | |
68 | |
57 | |
50 |
User | Count |
---|---|
166 | |
82 | |
68 | |
65 | |
54 |