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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Maureen
Helper III
Helper III

Keep a constant trend line when filtering

In this attached scatterplot, I have schools for the entire state with a trend line.  I would like to filter to certain schools to see where they are in relation to that trend line but when I do, the trend line fits to only the filtered data points.  Is there a way to keep the trend line constant and then HIGHLIGHT certain schools selected from the slicer?

 

Maureen_0-1675801011534.png

 

4 REPLIES 4
Vanchy_Liao
Advocate II
Advocate II

This is a good idea that adding a custom trend line with measure.

In my context, it is really useful, especially displaying forecast points.

 

reiff
New Member

The analytics lines, such as trend, are baked into PowerBI and as such you cannot build measures in there.

 

The formula that Jirka suggested would replace the value that you used in the visual, and is a measure that you build such as SUM ( SALES[sales] ). The idea is that ALL would remove the filters present in the visual and so the trend line would move with the schools that you choose. If you replicate the measure with your own values and introduce that into the visual then you should get what you need.

JirkaZ
Solution Specialist
Solution Specialist

Sure - you'll just have to ignore the filter using ALL in the calculation of the trend line. 

The sytax will be something like:

 

Trend Line Value All := CALCULATE([Trend Line Measure], ALL('Schools'))

 

Obviously you may need to tweak the formula so that it matches your expectations.

Thank.  I am not seeing an option to add a formula under the analytics tab for the scatterplot option . . .where could I add this formula to impose  the line on the scatterplot . . . .

 

Maureen_0-1675802980427.png

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.