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

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

Reply
Anonymous
Not applicable

Conditional format in Line chart

Hello all,

 

I need to make dynamic from a column with hexadecimal color codes, the color of the 5 lines of my line chart, but currently there is no conditional formatting feature for line chart, so I wonder if you have any ideas to do this.

 

Thanks a lot.

1 ACCEPTED SOLUTION

@Anonymous - Yes, This feature is not implemented at the moment. 

By creating measures, we can add that field in our visual and able to get the required line colors

 

Example: LineColor =
SWITCH (
TRUE (),
[YourMeasure] > Threshold1, "#FF5733", // Assign color based on condition
[YourMeasure] > Threshold2, "#33FF57",
[YourMeasure] > Threshold3, "#5733FF",
"#CCCCCC" // Default color
)

 

or you can refer the below link as well FYR.

Solved: Conditional Formatting a Line Chart in Power BI - Microsoft Fabric Community

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





View solution in original post

5 REPLIES 5
rajendraongole1
Super User
Super User

Hi @Anonymous - using switch or IF statement we can assign colors based on conditions or thresholds.

Example: LineColor =
SWITCH (
TRUE (),
[YourMeasure] > Threshold1, "#FF5733", // Assign color based on condition
[YourMeasure] > Threshold2, "#33FF57",
[YourMeasure] > Threshold3, "#5733FF",
"#CCCCCC" // Default color
)

 

I have taken the hexcodes from link: Color Hex Color Codes (color-hex.com)

 

1.select the "Line color" setting in the "Visualizations" pane, we can add it "Conditional formatting" and choose your newly created measure LineColor as the field

2.set up the conditional formatting rules as needed, mapping the hexadecimal color codes to the conditions specified in your measure.

 

rajendraongole1_0-1717411158253.png

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





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

Proud to be a Super User!





Anonymous
Not applicable

Hello rajendraongole1, thanks for your reply, but currently Conditional formatting it's not active for line chart:

 

Heeje__0-1717411582491.png

 

Nor if I select one of the categories:

 

Heeje__1-1717411716654.png

 

Hope someone can help me.

 

Thanks.

 

@Anonymous - Yes, This feature is not implemented at the moment. 

By creating measures, we can add that field in our visual and able to get the required line colors

 

Example: LineColor =
SWITCH (
TRUE (),
[YourMeasure] > Threshold1, "#FF5733", // Assign color based on condition
[YourMeasure] > Threshold2, "#33FF57",
[YourMeasure] > Threshold3, "#5733FF",
"#CCCCCC" // Default color
)

 

or you can refer the below link as well FYR.

Solved: Conditional Formatting a Line Chart in Power BI - Microsoft Fabric Community

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





Anonymous
Not applicable

This solution that you propose is feasible for, for example, a bar chart, since the conditional formatting function is implemented, but this solution does not work for the line chart, which is the one for which I am asking for help.

 

Thank you anyway.

@Anonymous ,
Conditional formatting is not supported on the line chart. This is still a limitation in Power BI. 

 

The workaround is to do it on the bar and convert it to a line to get a colored marker. But conditional formatting is not supported for multiple measures or legend in the line chart.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.