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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors