I'm trying to calculate ZSCORE basen on a measure created in DAX.
Measure would be:
Me1 = (CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES") + CALCULATE(sum('Data'[Amount]), 'Dim1'[Name2]="COST")) / CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES")
This is giving me the percentages by period.
Now my goal would be to calculate the Zscore of that measure, but I do not know the way to do it from a measure.
I have tried by creating a variable when creating the formula but it says "parameter is not the correct type":
Z-Score_new =
var calc = (CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES") + CALCULATE(sum('Data'[Amount]), 'Dim1'[Name2]="COST")) / CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES")
return
IFERROR((((CALCULATE(SUM(calc), FILTER(ALL('Data'[Date]), 'Data'[Date]= Max('Data'[Date]) )))) - AVERAGE(calc)) / STDEV.S(calc), BLANK())
Any idea or any suggestion of how I can get the calculation? Thank you in advance!