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
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!