A previous message helped me to develop a proper DAX measure to calculate a weighted average. Now I would like to add a measure for Standard Deviation. But my DAX measure continuously returns 0 as outcome:

The datamodel is about airlines, where each airline has one or more aircrafts. And each aircraft has a Standard and a Premium price scheme for both low and high season.

Generally the calculation explained:
–Step 1: Find the mean
–Step 2: Find each score’s deviation from the mean
–Step 3: Square each deviation from the mean
–Step 4: Find the sum of squares
–Step 5: Find the variance, divide the sum of the squares by N ( total population available capacity) or N-1 by a sample
–Step 6: Find the square root of the variance ===> standard deviation

I calculated Price - Weighted Average price and Price - Average Price in Excel, the differences are nihil.
See attached Excel. StDev.xlsx (10.8 KB)

I tried to build the above 6 steps in Power BI, but calculating differences (like price - WA price) in combination with Standard Deviation did not work, it gives null like you have experienced already.

Hi @Sebastiaan, due to inactivity, a response on this post has been tagged as “Solution”. If you have any concern related to this topic, you can create a new thread.