cancel
Showing results for 
Search instead for 
Did you mean: 
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

Accepted Solutions
Super User IV
Super User IV

Re: Conditional formatting of line chart

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.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: Conditional formatting of line chart

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.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

kadapavel Helper II
Helper II

Re: Conditional formatting of line chart

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

 

 

Super User IV
Super User IV

Re: Conditional formatting of line chart

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?


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

Super User IV
Super User IV

Re: Conditional formatting of line chart

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.


---------------------------------------

Putting square pegs in round holes since 1972.

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!
Did I answer your question? Mark my post as a solution!

Proud to be a Datanaut!

View solution in original post

kadapavel Helper II
Helper II

Re: Conditional formatting of line chart

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!

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

‘Better Together’ Integration Forum Launch

‘Better Together’ Integration Forum Launch

We've launched a how-to forum where you can learn about how Power BI integrates with other Power Platform products.

Top Solution Authors
Top Kudoed Authors