Outliers are observations that deviate significantly from the majority of values in a dataset. They can arise from various sources, including data entry errors, measurement inaccuracies, or unexpected system behaviour. However, not all outliers are necessarily errors. In many cases, they may represent valuable insights, such as fraudulent transactions, unusual customer behaviour, or significant changes in business operations. Identifying these unusual observations is therefore an important step in data analysis, helping organisations maintain data quality, uncover hidden patterns, and make more informed decisions.
One commonly used statistical technique for detecting outliers is the Z-score method. Unlike the IQR method, which identifies outliers based on the spread of the middle 50% of the data, the Z-score method measures how far an individual observation is from the dataset's mean in terms of standard deviations. It indicates whether a value is relatively close to the average or unusually far from it. A higher absolute Z-score suggests that the observation is more likely to be an outlier. Typically, observations with a Z-score below -3 or above +3 are considered potential outliers, although the threshold may vary depending on the dataset and application.
The Z-score method is particularly useful when analysing numerical data that approximately follows a normal distribution.
The Z-score is calculated by subtracting the dataset's mean from an individual observation and dividing the result by the standard deviation. This determines how many standard deviations a particular observation is above or below the mean.
The formula is:

Where:
- X – Individual data point (observation).
- µ – Mean of the dataset.
- s – Standard deviation of the dataset.
Import Data
Let us consider the following dataset, where our objective is to identify outliers in the Diameter_mm column using Power BI.

By using the Import data from Excel option, the above excel was imported to PowerBI and data is shown as below.

In Power BI, we can calculate the Z-score using DAX (Data Analysis Expressions) by creating a calculated column or measure. For outlier detection, I recommend using a calculated column because it assigns a Z-score to each individual observation, making it easier to identify and flag potential outliers.
Calculate the Mean
First, calculate the mean / average of the numerical column Diameter_mm of the Qualitymeasure dataset.
Mean Diameter_mm =
CALCULATE(
AVERAGE('QualityMeasurements'[Diameter_mm]),
ALL('QualityMeasurements')
)STDEV.S calculates sample standard deviation. If your dataset represents a population rather than the sampe, use STDEV.P.
Calculate the Standard Deviation
Next, calculate the population standard deviation. The Standard Deviation formula is:
CALCULATE(
STDEV.S('QualityMeasurements'[Diameter_mm]),
ALL('QualityMeasurements')
)Calculate the Z-score
Create a calculated column to calculate the Z-score for each observation using the previous observation.
Z-Score = (QualityMeasurements[Diameter_mm] - QualityMeasurements[Mean Diameter_mm]) / QualityMeasurements[Standard Deviation]
Once Z-score is calculated, we can use a table to show the values as shown below. We can filter the outlier using the following advanced filter for the Z-score in the filter pane.

With the above filter following records will be shown as the outliers.

The Z-score method provides a straightforward statistical approach to identifying potential outliers in a dataset. By measuring how far an observation deviates from the mean in terms of standard deviations, it helps analysts identify unusually high or low values that may require further investigation. With Power BI and DAX, this calculation can be easily incorporated into data models, allowing users to identify, classify, and visualise outliers as part of their analytical workflows