DAX code
Z-Score =
VAR CurrentValue = [Total Sales]
VAR Mean = CALCULATE(AVERAGE('Sales'[Amount]), ALLSELECTED('Sales'))
VAR StdDev = CALCULATE(STDEVX.P('Sales', 'Sales'[Amount]), ALLSELECTED('Sales'))
RETURN
DIVIDE(CurrentValue - Mean, StdDev)
Calculates how many standard deviations a value is from the mean, for spotting outliers.
Type your table and column names once. Every measure below updates.
Z-Score =
VAR CurrentValue = [Total Sales]
VAR Mean = CALCULATE(AVERAGE('Sales'[Amount]), ALLSELECTED('Sales'))
VAR StdDev = CALCULATE(STDEVX.P('Sales', 'Sales'[Amount]), ALLSELECTED('Sales'))
RETURN
DIVIDE(CurrentValue - Mean, StdDev)
ALLSELECTED anchors the mean and standard deviation to the report's overall selection rather than the current row context.
Browse all 175 measures in the Power BI DAX Measures Library, or search the library for something similar to Z-Score.