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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ELW
Advocate II
Advocate II

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
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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