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
8shipsbynight
Helper I
Helper I

Recalculate Outliers when filters are used

Hello - I have a boxplot visual that works as expected. However, I'd like to remove outliers by group and have the outliers recalculate based upon the filters being used. I was just going to use the following way to calculate outliers:

  • Lower Bound: (Q1 - 1.5 * IQR)
  • Upper Bound: (Q3 + 1.5 * IQR)

I know how to calculate all of this, but my bigger issue is figuring out how to recalculate outliers based on filters selected. Is this even possible?

 

here is a sample file: https://drive.google.com/file/d/1bjHuSDLECXyoe1vKElKCvMfXLHhfCnPx/view?usp=sharing

2 REPLIES 2
v-xiaosun-msft
Community Support
Community Support

Hi @8shipsbynight ,

 

If you want to do some calculations based on the values of the slicer, you can use SELECTEDVALUE function to create a measure as below.

Measure =
VAR _slice =
    SELECTEDVALUE ( MOCK_DATA[Color] )
RETURN
    CALCULATE (
        SUM ( MOCK_DATA[Number_Of_Times] ),
        'MOCK_DATA',
        'MOCK_DATA'[Color] = _slice
    )

vxiaosunmsft_1-1669710770762.png

If the above one can't help you get the desired result, please describe more clearly to me as below in order that we can help you further more.

1, What's your definition of outliers which should be removed?

2, What's "Q1" and "IQR"?

 

Best Regards,
Community Support Team _ xiaosun

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

Hi @v-xiaosun-msft  and thanks for the reply. I have updated my PBI file with a new calculated column "Outlier by Type."

https://drive.google.com/file/d/1bjHuSDLECXyoe1vKElKCvMfXLHhfCnPx/view?usp=sharing

It should help clear up what I'm trying to accomplish. If you choose "False" in the filter, this will give you all of the non-outlier data. If you choose True, you will view the outliers. (I was able to use the formulas from here: https://community.powerbi.com/t5/Desktop/Create-Calculated-column-for-Outliers-by-group/td-p/1817255). This is a great solution, however, the "Outlier by Type" column doesn't recalculate when you choose a slicer option. How can this be accomplished?

 

  • Q1 = the first 25% of the data
  • Q3 = the first 75% of the data
  • IQR = Interquartile range  (Q3-Q1)
  • My definition of outliers is anything above or below the Lower Bound and Upper Bound
  • Lower Bound: (Q1 - 1.5 * IQR)
  • Upper Bound: (Q3 + 1.5 * IQR)

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.