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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Finding data points outside of 2 Standard Deviations

Hello,

 

I am currently trying to to find data points of a column called "EPG" which fall outside of 2 standard deviations to remove outliers.

 

to get the Average: 

InternalEPGAvG = AVERAGE(PhenRQCJoinData[EPG])
 
To get the the std dev:
Internal St.Dev = STDEV.P(PhenRQCJoinData[EPG])
 

To find outliers in the data:

+2Std = COUNTAX(PhenRQCJoinData, PhenRQCJoinData[EPG] > PhenRQCJoinData[InternalEPGAvG] + PhenRQCJoinData[Internal St.Dev] * 2)
 
-2Std = COUNTAX(PhenRQCJoinData, PhenRQCJoinData[EPG] < PhenRQCJoinData[InternalEPGAvG] - PhenRQCJoinData[Internal St.Dev] * 2)
 
The problem is for both measures it returns the whole table (95) when it should be closer to 7.
 
Can anyone see what I am doing wrong here?
 
Here is the link to my Pbix File:
 
All Of the data and measures are on 'PhenRQCJoinData'
 
All help is greatly appreciated
 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

+2Std = VAR StandardDev =
	CALCULATE(
		STDEV.P( 'PhenRQCJoinData'[EPG] ),
		REMOVEFILTERS( 'PhenRQCJoinData' )
	)
VAR OverallAverage =
	CALCULATE(
		[Internal Average],
		REMOVEFILTERS( 'PhenRQCJoinData' )
	)
VAR NumOver =
	COUNTROWS(
		FILTER(
			'PhenRQCJoinData',
			'PhenRQCJoinData'[EPG] > OverallAverage + StandardDev * 2
		)
	)
RETURN
	NumOver

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

+2Std = VAR StandardDev =
	CALCULATE(
		STDEV.P( 'PhenRQCJoinData'[EPG] ),
		REMOVEFILTERS( 'PhenRQCJoinData' )
	)
VAR OverallAverage =
	CALCULATE(
		[Internal Average],
		REMOVEFILTERS( 'PhenRQCJoinData' )
	)
VAR NumOver =
	COUNTROWS(
		FILTER(
			'PhenRQCJoinData',
			'PhenRQCJoinData'[EPG] > OverallAverage + StandardDev * 2
		)
	)
RETURN
	NumOver
Anonymous
Not applicable

Thanks heaps, Worked well.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors