How can Standard Deviation be calculated in Power BI? (With an Example)

Standard Deviation is a statistical measure that calculates the amount of variation or dispersion in a dataset. In Power BI, the standard deviation can be calculated using the STDEV function. For example, let’s say we have a dataset of the monthly sales revenue for a company. Using the STDEV function, Power BI can calculate the standard deviation of this data, which will show us how much the monthly sales revenue varies from the average. This information can be used to identify any outliers or trends in the data and make informed business decisions. Additionally, Power BI also provides visualizations such as a standard deviation chart to help understand the data better.


You can use the following syntax in DAX to calculate the standard deviation of values in a column:

Std Dev of Points = STDEV.P('my_data'[Points])

This particular example creates a new measure named Std Dev of Points that calculates the standard deviation of values in the Points column of the table named my_data.

Note that there are four different standard deviation functions you can use in DAX:

  • STDEV.P: Returns the population standard deviation of values in a column.
  • STDEV.S: Returns the sample standard deviation of values in a column.
  • STDEVX.P: Returns the population standard deviation for an expression evaluated row by row over a table.
  • STDEVX.S: Returns the sample standard deviation for an expression evaluated row by row over a table.

The following example shows how to calculate the standard deviation of a column in Power BI in practice.

Related:

Example: How to Calculate Standard Deviation in Power BI

Suppose we have the following table in Power BI named my_data that contains information about points scored by basketball players on various teams:

Suppose we would like to calculate the standard deviation of values in the Points column.

To do so, click the Table tools tab along the top ribbon, then click the New measure icon:

Then type in the following formula into the formula bar:

Std Dev of Points = STDEV.P('my_data'[Points])

This will create a new measure named Std Dev of Points that contains the standard deviation of values in the Points column of the table:

Power BI calculate standard deviation

This will produce the following card that displays the standard deviation of values in the Points column of the table:

We can see that the standard deviation of values in the Points column is 6.83.

If we click on any of the individual names in the Team column of the table in the report, then the card will automatically update to show the standard deviation of points for that particular team.

For example, suppose we click the Mavs team name in the table:

The card automatically updates to show that the standard deviation of values in the Points column for the Mavs is 2.59.

Additional Resources

The following tutorials explain how to perform other common tasks in Power BI:

x