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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
kadapavel
Helper II
Helper II

Conditional formatting of line chart

Dear Experts

Is there any way to change colour of part of line chart that exceeds certain level/value.

Capture temperature.PNG

I would colour red the part of temperature chart that exceeds 40C.

Thanks in advance!

 

1 ACCEPTED SOLUTION

OK, I created an Enter Data query like this:

 

DateTemp

Tuesday, August 22, 201730
Wednesday, August 23, 201735
Thursday, August 24, 201736
Friday, August 25, 201737
Saturday, August 26, 201738
Sunday, August 27, 201739
Monday, August 28, 201740
Tuesday, August 29, 201741
Wednesday, August 30, 201742
Thursday, August 31, 201740

 

I created two measures like this:

 

Temp1 = IF(SUM(Temperatures[Temp])>40,BLANK(),SUM(Temperatures[Temp]))

Temp2 = IF(SUM(Temperatures[Temp])>40,SUM(Temperatures[Temp]),BLANK())

Put both of these as Values in a line graph with an axis of Date. Not the exact effect I was going for but did display both lines in different colors.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Not to my knowledge with the OOTB line chart. Might look into a custom visual or R visualization. Would be a really nifty feature, you should suggest it as an Idea if it is not already out there. I'd vote for that.

 

One thought, could you potentially break up your value that you are charting such that it is the same metric but filtered to either be below or above 40C? Then you could put both measures into the line chart and color them differently. Would need to see sample data though.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hello 

I tried to split... but it seems I do something wrong as result is 2 identical charts

Measure1 = if(MAX([Value])>40;BLANK();MAX([Value]))

Measure2 = if(MAX([Value])<40;MAX([Value]);BLANK())

Capture temperature2.PNG

 

 

OK, I created an Enter Data query like this:

 

DateTemp

Tuesday, August 22, 201730
Wednesday, August 23, 201735
Thursday, August 24, 201736
Friday, August 25, 201737
Saturday, August 26, 201738
Sunday, August 27, 201739
Monday, August 28, 201740
Tuesday, August 29, 201741
Wednesday, August 30, 201742
Thursday, August 31, 201740

 

I created two measures like this:

 

Temp1 = IF(SUM(Temperatures[Temp])>40,BLANK(),SUM(Temperatures[Temp]))

Temp2 = IF(SUM(Temperatures[Temp])>40,SUM(Temperatures[Temp]),BLANK())

Put both of these as Values in a line graph with an axis of Date. Not the exact effect I was going for but did display both lines in different colors.



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

It works. Not very elegant solution with continous X axis, categorical for some reason cuts big part of data. Hopefully in next revisiont that will look better.

Thanks for support!

Hmm. Really tough to be specific here, I may have to invent some sample data to play with. Perhaps if you filtered your data on import to above and below 40 and put them in separate tables? I'm going to play with this one, should be easy enough to generate some sample data, I assume that your x-axis is date/time based?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors