cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
aalcaide
Frequent Visitor

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

Accepted Solutions
Community Support
Community Support

Re: Stablished randoms and different colors for charts values

HI @aalcaide ,

 

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 Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

3 REPLIES 3
Community Support
Community Support

Re: Stablished randoms and different colors for charts values

HI @aalcaide ,

 

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 Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
aalcaide
Frequent Visitor

Re: Stablished randoms and different colors for charts values

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. 

Community Support
Community Support

Re: Stablished randoms and different colors for charts values

HI @aalcaide ,

 

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 Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI

View solution in original post

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors