Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
QUESTION
For a bar chart on a dashboard with a custom JSON theme, what is the logic behind which elements are assigned to which datacolors?
MY SETUP
I have several hybrid datasets created using the API which have equivalent reports created from them. Each of these reports contains a bar chart that gets pinned to a dashboard so they can all be seen updating at once. I have created a custom theme for these so that my bar charts have a consistent coloring, specifically each category in the bar chart legend should have the same color between bar charts.
BACKGROUND AND TESTING
My goal is set up this theme so that when all the charts have both categories, these categories are consistently colored between charts. For the purposed of this question, we can say the legend contains the following categories: [blank] (always filtered out), A, and B.
My operating assumption had been that the legends were ordered alphabetically and that A would get datacolor 1 from JSON theme and B would get color 2. While not all the charts had both A and B represented in their data this early, initial testing of the theme showed that my assumption wasn't quite accurate. The first datacolor didn't seem to be used (perhaps it's for [blank], which I'm not plotting?) though the 2nd and 3rd colors seemed to behave as expected other than the offset in that A was getting color 2 and B was getting color 3. But when one of the datasets refreshed and it displayed the A for the first time, it didn't use the 2nd datacolor as the other charts had, it used the 7th instead. I was able to work around by changing that unused datacolor to match datacolor 2, but I'm worried that further inconsistencies could result in a color I am using elsewhere being used for A on one of the remaining charts so I need to understand how these are assigned and if it can be controlled.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 |