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
laciodrom_80
Helper IV
Helper IV

Line Chart: how to warn when values differences between two lines when exceeding a threshold

Hi guys,

 

I've got a line chart which displays two lines representing two temporal series: I'd like to highlight somehow when the difference between the values of the two lines exceed a threshold, any clue - example about it?

 

Thanks in advance!

Luca
6 REPLIES 6
itayrom
Resolver II
Resolver II

I don't think the line chart visual offers this kind of behavior. The closest thing it has is the reference line, but I guess it's not what you're looking for. The best option I can think of at the moment is to create two calculated columns for each column displayed on the line chart, defined as follows:

1. ColNameBelowThreshold = IF([ColName] <= threshold[ColName], BLANK());

2. ColNameOverThreshold = IF([ColName] > threshold[ColName], BLANK());

3. threshold can be a variable, a static value, or a calculation of some sort that represents the desired threshold.

4. You might need to tweak the above formulas a bit, depending on your data, so that one line would pick up where the other one ends.

 

You could then display them both on the line chart, and give ColNameOverThreshold a different color in the "Data Colors" menu in the formatting pane to make it apprear highlighted.

gkhare
Frequent Visitor

Hello Luca,

 

I' am also stuck with the same scenario where I need to ive a warning message/pop up if for eg sales target are not achieved etc.. 

If you found solution to the above then please guide me as well

 

Thanks in advance

Gaurav

@gkhare, regarding your case, what I would do is as follows:

1. Add a measure with a DAX formula with the following structure- TagetsNotAchieved = IF(calculation, warning_msg, else_msg), where:

  • calculation is a calculation to check if the target was achieved(E.g. SUM([Sales]) >= target).
  • warning_msg is a static textual to be shown when the target was not achieved(E.g. "Sales target is not achieved").
  • else_msg is a static textual value to be shown when the target was achieved,or an empty string(I.e. "") if you don't want a message to be shown.

2. Add a card visual to your report, and set the TagetsNotAchieved measure as its field.

3. Change the Card's formatting to make it look more "warningy".

Hi,

 

Many Thanks for providing solution...

One more help required..kindly guide me on how to send alert in form of an email if the difference of value/target exceeds a threshold limit.

 

Regards

GK

@gkhare, I hardly think Microsoft would provide a way for sending emails from custom visuals, since it poses a great security risk. E.g. you could write a custom visual that would send you confidential data from corporations using it. Therefore, I'm pretty sure that custom visuals running in a sandboxed environment would not be able to do so.

 

In theory, though, if that functionality wasn't blocked, I would use ajax to notify a remote server with email-sending capabilities that the threshold was exceeded.

Many thanks ItayromSmiley Happy

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.