
Using simple table
| Measurement | Value |
| 1 | 32.5 |
| 2 | 30.4 |
| 3 | 31.6 |
I want to add a new column called ZSCORE which would be ( [Measurement] - average([Value]) ) / standard_deviation([Value])
I created a new query (custom function) called fnZScore
let ZScore = (column as list) =>
let
average = List.Average(column),
sdev = List.StandardDeviation(column)
in
Table.AddColumn( "Z-Score", each (average - [Value])/sdev)
in
ZScore
I then tried to add an Invoke Custom Function Step
However, this returns the following error: Expression.Error: A cyclic reference was encountered during evaluation.
Any suggestions on how to alter this custom function?