Suppose you've to obtain the Standard Deviation of the following data;
The mean(average) of the sample set = 5
First, you need to calculate the deviation of each element from the mean. (Basically, the squared difference of each element from the mean)
The mean of all deviations is the population variance. In this case, it is 4.
And the standard deviation is the square root of the population variance =2.
If you convert it into its Power BI equivalent,
And the measure is created as follows, the tricky part is to make use of the SUMX function. It's always convenient to break down the intermediate steps with VAR to make it more clear.
As a result, you get,
P.S. Power BI does have a built-in function for calculating standard deviation(e.g. STDEVX.P). However, it's not always useful. Do feel free to check it out though.