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
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.


@ 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...

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

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.


@ 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...

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.


@ 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...

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?


@ 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.