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
weijunawj
Frequent Visitor

Display message when data points exceed reference line

Hi, i have a line chart with a reference line below. How can i display a message whenever my data point exceeds the reference line?

weijunawj_1-1622087284246.png

 

 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @weijunawj 

In addition to 's reply, I will show the way in details.

Firstly, I need to know how did you get the reference line. Is it an average line in visual analysis?

1.png

If you want to show different colors to distinguish whether the value exceeds the average, build a measure as below.

Color = 
VAR _AVERAGE = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
RETURN
IF(SUM('Table'[Value])>_AVERAGE,"RED","BLUE")

Build a bar chart and use FX in Data color in Format.

2.png

Select Field value in Format by and based on color measure. Then select ok and transform the bar chart to line chart.

3.png

Result is as below.

4.png

If you need to a tooltip to show whether the value exceeds the average, you can change the result in color measure and add this measure into tooltips in this visual.

Tooltips = 
VAR _AVERAGE = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
RETURN
IF(SUM('Table'[Value])>_AVERAGE,"Above Avg","Below Avg")

To see the  tooltip, you need to hang your mouse on the point in line chart. Or the tooltips will be hidden.

5.png

You can build a tooltip based on report page as well. 

For reference: Create tooltips based on report pages in Power BI Desktop

 

Best Regards,

Rico Zhou

 

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

View solution in original post

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

Hi @weijunawj 

In addition to 's reply, I will show the way in details.

Firstly, I need to know how did you get the reference line. Is it an average line in visual analysis?

1.png

If you want to show different colors to distinguish whether the value exceeds the average, build a measure as below.

Color = 
VAR _AVERAGE = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
RETURN
IF(SUM('Table'[Value])>_AVERAGE,"RED","BLUE")

Build a bar chart and use FX in Data color in Format.

2.png

Select Field value in Format by and based on color measure. Then select ok and transform the bar chart to line chart.

3.png

Result is as below.

4.png

If you need to a tooltip to show whether the value exceeds the average, you can change the result in color measure and add this measure into tooltips in this visual.

Tooltips = 
VAR _AVERAGE = CALCULATE(AVERAGE('Table'[Value]),ALL('Table'))
RETURN
IF(SUM('Table'[Value])>_AVERAGE,"Above Avg","Below Avg")

To see the  tooltip, you need to hang your mouse on the point in line chart. Or the tooltips will be hidden.

5.png

You can build a tooltip based on report page as well. 

For reference: Create tooltips based on report pages in Power BI Desktop

 

Best Regards,

Rico Zhou

 

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

amitchandak
Super User
Super User

@weijunawj , One way is to create conditional formatting on bar visual and convert back to the line.  But if the other line is not avg line and is measure it might not work

 

Color  =

if( [Value] > [Avg Value], "Green",

"Blue"

)

 

Use in conditional formatting with a field value option 

 

or create a measure and use on tool tip

 

Color  =

if( [Value] > [Avg Value], "Above Avg",

"Below Avg"

)

 

 

 

Hi sir, sorry i'm new to power bi. How can i create a measure and use on tool tip as mentioned in your reply? and where do i enter the condition "

Color =

if( [Value] > [Avg Value], "Above Avg",

"Below Avg"

)" ?

Thank you

@weijunawj , Assume you have a measure value, then you can create a new meausre

 

Color =
var = calculate([Value], allselected(Table))
return
if( [Value] > [Avg Value], "Above Avg", "Below Avg" )

 

Then add that to tooltip (Visual Pane)

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.