How to Calculate Standard Deviation in Power BI (With Example)


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: When to Use Population vs. Sample Standard Deviation

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

If we’d like, we can display this value by going to the Report View in Power BI, then by clicking the Card icon under the Visualizations tab, then by dragging the Std Dev of Points measure under the Fields label:

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:

How to Count Number of Occurrences in Power BI
How to Use “If Contains” in Power BI
How to Write an IF Statement in Power BI

Leave a Reply

Your email address will not be published. Required fields are marked *