Try to Pivot all the measure values. follow the below link.
you will be getting two fields along with your Dimension fields, pivot field names & pivot field values.
replace the generated fields in your calculated field. i am not sure this will help your or not.
please provide some sample workbook if possible.
Yes, pivoting allows calculations to be done for all measures at once. However, the centering and scaling steps shown in the original post are done wrt all data, not just the data related to the measure. Thus, the calculations are not correct.
I will try to put together a small example workbook.
Turns out the incorrect calculations were occurring when a separate variable (used primarily for coloring the data points) was being interpreted as a dimension. When I converted it to an attribute, the calculations are correct.