Forum Discussion
tobiasmcbride
6 years agoHelper III
Calculating variance
Hi, I have some revenue data and am struggling to calculate the variance of this. The data is formatted as below: Forecast Type Q1 Q2 Q3 Q4 FY19 Budget Total $$$ $$ $$$ $ F...
- 6 years ago
Hi tobiasmcbride ,
First, add a [index] column in Edit Queries;
Second, create a measures for Q1, Q2, Q3:
Measure for Q1, Other similar:
variance _Q1 = VAR x = CALCULATE( MAX(Sheet2[Q1]), FILTER( Sheet2, Sheet2[Index] = MIN(Sheet2[Index]) ) ) VAR y = CALCULATE( MAX(Sheet2[Q1]), FILTER( Sheet2, Sheet2[Index] = MAX(Sheet2[Index]) ) ) RETURN DIVIDE( x-y, y )Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lionel-msft
6 years agoCommunity Support
Hi tobiasmcbride ,
First, add a [index] column in Edit Queries;
Second, create a measures for Q1, Q2, Q3:
Measure for Q1, Other similar:
variance _Q1 =
VAR x =
CALCULATE(
MAX(Sheet2[Q1]),
FILTER(
Sheet2,
Sheet2[Index] = MIN(Sheet2[Index])
)
)
VAR y =
CALCULATE(
MAX(Sheet2[Q1]),
FILTER(
Sheet2,
Sheet2[Index] = MAX(Sheet2[Index])
)
)
RETURN
DIVIDE(
x-y,
y
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.