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

Stablished randoms and different colors for charts values

Hello everyone! 

 

We would like to figure it out how to stablished different colors for a chart without selecting it in the format panel > Data Colors. The reason is that we have a lot of values with different elements in legend (25 or more) so we would want to generate random and different colors for every element in legend, so it wouldn't have the same color for two differents values and it would not be repeated. It's a line chart what we would want to set, because we have seen some solutions for bar chart.

 

Any suggestion about it? 

 

Thanks in advance!

 

Alicia.

1 ACCEPTED SOLUTION

HI @Anonymous ,

 

Maybe you can try to use RANDBETWEEN function with hex number for color formatting, it can random generate color code.

 

Regards,
Xiaoxin Sheng

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

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @Anonymous ,

 

I'd like to suggest you enable conditional formatting feature with if statement to setup custom colors for different value range.

Conditional formatting in tables

 

Notice: if you enable legend field, power bi will recognize your categories and setup their colors based on category label.

 

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

Hi: 

 

Thank you so much for this solution. It very useful but we need to set different color for Line Chart. In the legend of the Line Chart I have like 15/20 different elements and I would want to set different colors for every element, in order to not get repeated color for two different values and make easy the interpretation of the chart. 

 

We tried with a JSON, with setting variables... but it did not work. 

 

Thanks again.

Best regards. 

HI @Anonymous ,

 

Maybe you can try to use RANDBETWEEN function with hex number for color formatting, it can random generate color code.

 

Regards,
Xiaoxin Sheng

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

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.