cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aalcaide Frequent Visitor
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 Team
Community Support Team

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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
3 REPLIES 3
Community Support Team
Community Support Team

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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
Highlighted
aalcaide Frequent Visitor
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 Team
Community Support Team

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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |