Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I am trying to show the Z-Score for each employee in a table matrix.
I am using slicers to filter for different zones employees are in.
I am not sure how to write the DAX for the following variables:
TotalTests
TotalEmployees
AverageTests
StddDev
With my slicer = "Zone 1"
Employee1 did 234 tests
Employee2 did 221 tests
Employee3 did 190 tests
Employee4 did 75 tests
Total Tests = 720
Total Employees = 4
TotalTests = 720
TotalEmployees = 4
AverageTests = 180
Desired Table Matrix:
| Employee | TotalTests | AverageTests | Standard Deviation | Z-Score | ||
| Employee1 | 234 | 180 | 72.39 | .75 | ||
| Employee2 | 221 | 180 | 72.39 | .57 | ||
| Employee3 | 190 | 180 | 72.39 | .14 | ||
| Employee4 | 75 | 180 | 72.39 | -1.45 |
Did you try this one
CountTests = Count(EmployeeData[Tests])
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
//Replace table & Column with yours---This might help you
Z-Score =
VAR TotalTests = SUM(EmployeeData[Tests])
VAR TotalEmployees = COUNTROWS(FILTER(EmployeeData, [Zone] = SELECTEDVALUE('Slicer'[Zone])))
VAR AverageTests = AVERAGE(EmployeeData[Tests])
VAR StddDev = STDEV.P(FILTER(EmployeeData, [Zone] = SELECTEDVALUE('Slicer'[Zone]))[Tests])
RETURN
DIVIDE(TotalTests - TotalEmployees, StddDev)
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Thank you for the quick response.
How do I get the count of tests?
Employee 1 did 234 tests. Each test is recorded as a new row in my tests table.
| TestId | Employee |
| A13 | Employee 1 |
| B34 | Employee 1 |
| C43 | Employee 1 |
CountTests = Count(EmployeeData[Tests])
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
I have 2 tables with much more data than show below, just using these as examples.
Employee Data
| Employee ID | Employee Name |
| 1 | Employee1 |
| 2 | Employee2 |
Test Data
| TestID | Employee ID |
| A13 | Employee1 |
| B34 | Employee1 |
| C43 | Employee1 |
| A13 | Employee2 |
| D56 | Employee2 |
| W43 | Employee3 |
I need to show counts
Employee1 did 3 tests
Employee2 did 1 test
Employee3 did 1 test
//Trythisone
Test Count =
COUNTROWS(
SUMMARIZE('Test Data', 'Test Data'[Employee ID], 'Test Data'[TestID])
)
Did I answer your question? If so, please mark my post as a solution!
Proud to be a Super User!
Sorry for the back and forth, I wish there was a way to live chat.
That is giving me the count of test per employee, I need it to return the count of total tests.
Employee1 234 tests
Employee2 221 tests
Employee3 190 tests
Employee4 75 tests
I need the formula to return Total Tests = 720
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 51 | |
| 35 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 92 | |
| 75 | |
| 41 | |
| 26 | |
| 25 |