This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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])
//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)
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])
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])
)
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
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 36 | |
| 29 | |
| 29 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 69 | |
| 39 | |
| 33 | |
| 24 | |
| 23 |