Standard Deviation in Power BI [With Examples]

This Power BI tutorial helps you to understand how to calculate standard deviation in Power BI measures.

Recently, I worked on a Power BI report where I needed to calculate the standard deviation in sales data using the STDEV.P() function, and I could do so successfully.

In this tutorial, we learned about the Power BI standard deviation measure and how to calculate standard deviation using the Power BI measure. Also, I will tell you how to calculate the standard deviation in Power BI Power Query.

Standard Deviation in Power BI

In Power BI, standard deviation is a statistical measure that tells you how spread out your data is from the average (or mean) value. It helps you understand the variability within your dataset.

Power BI Standard Deviation function syntaxes:

Syntax – 1:

STDEV.P(<ColumnName>)

Where:

  • ColumnName = The name of an existing column. It cannot be an expression.

It Returns the standard deviation of the entire population.

Syntax – 2:

STDEV.S(<ColumnName>)

Where:

  • ColumnName = The name of an existing column. It cannot be an expression.

It Returns the standard deviation of a sample population.

Let’s say you have a dataset of students’ test scores in a class. The average score tells you the typical performance, but the standard deviation tells you how much the scores vary from that average.

For example, if the average score is 70 with a standard deviation of 5, most scores are close to 70, and there’s not much difference between them. But if the standard deviation is 15, scores are more spread out. Some might be much higher than 70, and some might be much lower.

How to Calculate Standard Deviation in Power BI Measure

Now, I will show you how to calculate standard deviation in power BI.

Here, I have a SharePoint list (Orders) that contains below columns with various data types:

ColumnsData Types
Order DateDate and time
Product NameSingle line of text
CategorySingle line of text
Sub-CategorySingle line of text
SalesCurrency
ProfitCurrency
power bi standard deviation of a measure

Follow the below steps to calculate the standard deviation in Power BI

Now, I am creating for the sample population like you can create an entire population.

1. Open Power BI Desktop and load the data. Then, you see data in the Data pane.

how to calculate standard deviation in power bi

2. Under the Home tab, click the New measure.

calculate standard deviation in power bi measure using dax

3. In the formula bar, put the below expression.

Standard Deviation = STDEV.S(Orders[Sales])

Where:

  • Standard Deviation = Name of the Measure
  • Orders = Name of the Table
  • Sales = Name of the Column
How to find STD in power bi measure

4. Click the Home tab -> Expand Visual gallery(black box) -> Click the Card visual.

Standard Deviation in Power BI measure

5. Then, using the +Add data option, add the Standard Deviation into the Data field.

Standard deviations of a calculated measure in Power BI

6. After that, you can see the standard deviation result in the Power BI Card visual.

How do I calculate standard deviation from Power BI measure

This way, you can calculate the standard deviation in the Power BI measure.

How to Calculate Standard Deviation in Power BI Power Query Editor

Now, we will see how to calculate standard deviation in Power Query Editor. I hope you load the data set.

1. Under the Home tab, click Transform data.

Calculate Standard Deviation in Power Bi Power Query

2. Select the column you want to calculate the standard deviation. In my case, Sales.

Standard deviation calculation through Power query in Power Bi

3. Goto Transform tab, expand Statistics and select Standard Deviation.

standard deviation in Power bi power query

4. After that, you see the Standard Deviation of sales.

Generating standard deviation in Power BI Power Query

This way, you calculate the standard deviation in Power BI Power Query.

Conclusion

I hope you follow all the steps to create a standard deviation in Power BI.

This tutorial taught us the standard deviation in Power BI and how to calculate standard deviation in Power BI measures. Additionally, we learned how to calculate the standard deviation in Power BI Power Query.

Furthermore, you may like some more Power BI articles: