What is the optimal way to create a calculated measure to compute a custom variance formula (I cannot use the default Variance function because it does not accommodate custom weights). So the leaf level formula will have 2 components one component will be a fact at the leaf level and the other component will be a parent aggregate at various levels in the hierarchy. So the formula is as follows: (Need this computed at each leaf level)
(a-b)^2
Where a is a leaf level fact [Measure].[Score] b is a parent level aggregate ([Dim].[Level].[All], [Measure].[MeanScore])