Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
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.
Solved! Go to 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!!
Proud to be a 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.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Hello rajendraongole1, thanks for your reply, but currently Conditional formatting it's not active for line chart:
Nor if I select one of the categories:
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!!
Proud to be a Super User! | |
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.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 80 | |
| 40 | |
| 31 | |
| 27 | |
| 27 |