Z Scores in DAX

HI,

Does anyone have any experience of getting Z Scores to work via a DAX measure?

I Can do it easy enough using a calculated column however its to static that way and i want to apply filters to my table and have the z score re calculate for the filtered data.

Attached is my PBIX file its an import from my SAP data, the columns i want to filter against i have set up as slicers at the top.

I believe all my formulas for Std Dev and Mean are correct however when i filter my data table (shown by the arrow in the screen shot) the Z score doesn’t adjust to the filter, It shows the mean for all the data. but all the cards with the measure on adjust to the correct data its just i cant get the z score in the table to do the same for some reason.

Power BI Initiatives.pbix (1.2 MB)

Ive solved this one

If anyone has the same issues i created 4 measures and put them in my table using the all selected function.

Actual Minutes = SUM(‘SAP Last 40 Ship Sets (Hassan)’[Actual Minutes])

Mean = AVERAGEX(ALLSELECTED(‘SAP Last 40 Ship Sets (Hassan)’),[Actual Minutes])

Std Dev = STDEVX.S(ALLSELECTED(‘SAP Last 40 Ship Sets (Hassan)’),[Actual Minutes])

ZScore = DIVIDE(([Actual Minutes]-[Mean]),[Std Dev])

Capture