Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Assign data colors to specific category/series

Hi all - we are trying to assign specific colors to specific series on the pie chart , as data is being entered into the underlying excel/data source is being updated. For example, if initially the pie chart or visual is blank and a user enters a value ($ amount) under the category of sales ("Retail" for example), then the value should be populated in the pie chart as the color hex code red. 

I know that the JSON data colors are available, but they are assigned in random order when data values (measures) are plotted on the chart i noticed , like red could be assigned to "Healthcare" sales if the user enters data in there first. 

However, we have defined rules and organizational color theme that maps red (#FF0000) to "Retail". How do i ensure that the JSON file colors are applied to the appropriate categories ? (e.g. if user enters value for EMR, it should have been assigned to color blue instead of the red one you can see in the screenshot. LS should have been assigned to the green color instead of yellow etc.)

 

2019-10-17_21-32-08.png

 

 

Thanks all!

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

AFAIK, current 'conditional formatting' feature only works on table and matrix visuals.
If you do not use any field on legend, you can try to use advanced color formatting feature, it also allows you to do color formatting on 'Data colors' panel, it is similar to conditional formatting.

BTW, color formatting seems not works on Pie chart, you can create other type of visuals(stacked column/bar chart) and apply color formating, then switch visual type to Pie chart. (Power bi will keep enabled previous visual 'data colors' settings)
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

But even conditional formatting i can only use once i actually have data in the underlying dataset correct? I am trying to set colors to categories even before there are any data in the dataset. 

I guess this is not currently possible then in Power BI.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.