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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! 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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.