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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Color code Multiple lines in a single chart

Hello All,

 

I have a chart where I am showing my NPS for 3 locations with multiple lines in a single line chart.

Locations are India,USA and Canada

So I am using diffeent shapes here for each line .(star,rectangle and square)

 

Now my requirement is I need to change my 3 line colors based on nps score.

So if nps is morethan 90 it should be green and lessthan 90 it should be red.

 

is it possble ?

 

Could anyone please suggest how to do this for all 3 lines in the chart.

 

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

For the line chart, each line can only display one color (which can be customized), but it is not possible to specify the color of a line segment based on a conditional judgment. This is mainly different from legends, which can cause color conflicts. But similar to table visual, you can set the color under different conditions by customizing the condition. Reference as follows.

vhenrykmstf_0-1661331622869.png

M =
IF (
    MAX ( 'Table'[Value] ) > 90,
    "green",
    IF ( MAX ( 'Table'[Value] ) < 90, "red", "yellow" )
)

 

vhenrykmstf_1-1661331677445.png


If the problem is still not resolved, please provide detailed error information and 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.

View solution in original post

4 REPLIES 4
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

For the line chart, each line can only display one color (which can be customized), but it is not possible to specify the color of a line segment based on a conditional judgment. This is mainly different from legends, which can cause color conflicts. But similar to table visual, you can set the color under different conditions by customizing the condition. Reference as follows.

vhenrykmstf_0-1661331622869.png

M =
IF (
    MAX ( 'Table'[Value] ) > 90,
    "green",
    IF ( MAX ( 'Table'[Value] ) < 90, "red", "yellow" )
)

 

vhenrykmstf_1-1661331677445.png


If the problem is still not resolved, please provide detailed error information and 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.

danextian
Super User
Super User

Hi @Anonymous ,

 

That should be possible with conditional formatting. Can you please post a sample data that we can easily manipulate as well as a screenshot of your chart?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

Hi @danextian ,

 

Below is screenshot with sample data.

I dont see conditional color coding option for the lines

Sathvik123_0-1660631584792.png

 

Apologies. I've realized that conditional formatting of lines in a line chart  is not currently supported. Only the markers can be and there shouldn't  be a legend. You can vote for that idea here:

https://ideas.powerbi.com/ideas/idea/?ideaid=ca2bb8a9-9af6-eb11-ba5e-281878bd73ba 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors