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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chiru5262
Helper III
Helper III

Conditional formatting Line Chart

Hi,

 

Wondering if I can condition format a Line chart in power bi or alternatively if there is any custom visual to use.

 

Appreciate your help.

 

kind Regards,

Chiru

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Your post has been changed because invalid HTML was found in Hello there,
I am following your option to solve the graph, but there are some parts that do not conform to reality, I indicate it in the screenshot.
I would appreciate your telling me what I may be doing wrong. Thank you.
Captura datos.JPGCaptura grafico lineas rojo.JPG
v-zhenbw-msft
Community Support
Community Support

Hi @chiru5262 ,

 

We create a sample and you can refer it.

 

1. Create a line chart using value. And configure an alert line.

 

line 1.jpg

 

2. Then we can create a measure using IF function.

 

greater than 20 = IF(CALCULATE(SUM('Table'[value]))>20,CALCULATE(SUM('Table'[value])),BLANK())

 

Put the measure to line chart and change its color, the result like this,

 

line 2.jpg

 

If it doesn't meet your requirement, Could you please show the exact expected result based on the tables that we have shared?

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

How can I achieve if the data before the current one is lower, the color is black, and if the data is less than the current one, the color is red.

Greg_Deckler
Super User
Super User

I am not aware of a way to conditional format a line chart, are you trying to control the colors of legend items or the color of the line depending on values?

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.