Forum Discussion
tomperro
2 years agoHelper V
Z-Score in Table Matrix Visual
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 varia...
mh2587
2 years agoSuper 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)
tomperro
2 years agoHelper V
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 |
- mh25872 years agoSuper User
CountTests = Count(EmployeeData[Tests])- tomperro2 years agoHelper V
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
- mh25872 years agoSuper User
//Trythisone Test Count = COUNTROWS( SUMMARIZE('Test Data', 'Test Data'[Employee ID], 'Test Data'[TestID]) )