cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ELW
Advocate I
Advocate I

Line Chart - Color series by field value

Is there a way to format series based on a field value for Line Charts?

 

I have a data set with many, many possible series depending on what slicer values are selected (so formatting individually is not a good option).  Each series is associated with a label and a hex code color.  I'd like to dynamically color each line based on the hex code values, like how other visuals let you do Data Colors / fx / Format By / Field Value.  That doesn't seem to be an option in the Line Chart's formatting, and I'm wondering if there's a workaround.  

 

I've made a simplified example with fake data and a fake graph of what I want.  Here's an example file.  In the example file, I've manually colored each series, but in my actual data that's not feasible since there's a huge pool of possible series that would get updated...  I need a way to link it to the Color field.  

 

XYLabelColor
2000202564A#FF0000
3000273856A#FF0000
3800324242A#FF0000
2085216122B#00FF00
3085282371B#00FF00
3885344387B#00FF00
2170236258C#0000FF
3170304727C#0000FF
3970352281C#0000FF

 

ELW_0-1616786187414.png

 

I'm very new to R, but open to an R Script Visual solution if that's an option.

 

1 REPLY 1
v-henryk-mstf
Community Support
Community Support

Hi @ELW ,

 

According to your needs, some visual can customize the color series by creating a measure in the Format-->Data colors. Here is a related link. I hope to help you solve the problem.Conditional formatting by field value in Power BI - Power BI Docs


If the problem is still not resolved, please provide detailed error information. Let me know immediately, looking forward to your reply.

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Top Solution Authors