Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

ZSCORE from Measure

Hello,

 

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 creaing 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 sugestion of how I can get the calculation?
Thank you in advance!
2 REPLIES 2
v-henryk-mstf
Community Support
Community Support

Hi @Anonymous ,

 

According to your requirements, you can directly return the created parameter and observe its return value unit format, because it is possible that sum (parameter) and average (parameter) do not support calculating percentages. The format can be modified in Format. If it is not caused by the above reasons, whether we can provide a detailed data model and expected results, I will answer for you as soon as possible.

v-henryk-mstf_0-1619767994937.png

 

Let me know the result immediately, looking forward to your reply.

 

Best Regards,
Henry

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hello @v-henryk-mstf !

Thank you for your comments.

 

I have created a new measure called "MyMeasure" and saved it as whole number as follows:

MyMeasure = (CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES") + CALCULATE(sum('Data'[Amount]), 'Dim1'[Name2]="COST")) / CALCULATE(SUM('Data'[Amount]),'Dim1'[Name]="SALES")

 

However, now if I try to created a new measure, lets say "NewMeasure" base on "MyMeasure", PowerBI does not allow me to select it. It would like as follows:

 

NewMeasure = IFERROR((((CALCULATE(SUM(MyMeasure ), FILTER(ALL('Data'[Date]), 'Data'[Date]= Max('Data'[Date]) )))) - AVERAGE(MyMeasure )) / STDEV.S(MyMeasure ), BLANK())

 

Is it possible what I am trying to do? Or should I try any other way?

Thank you again!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors