Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
tomperro
Helper V
Helper 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 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

StddDev  = STDEVX.P (  ?  )  * should equal 72.39
ZScore = DIVIDE ( TotalTests - TotalEmployees , StddDev )
 

 

Desired Table Matrix:

EmployeeTotalTestsAverageTestsStandard DeviationZ-Score  
Employee123418072.39.75  
Employee222118072.39.57  
Employee319018072.39.14  
Employee47518072.39-1.45  

 

7 REPLIES 7
mh2587
Super User
Super User

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!




LinkedIn Icon
Muhammad Hasnain



mh2587
Super User
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!




LinkedIn Icon
Muhammad Hasnain



@mh2587 

 

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.

TestIdEmployee
A13Employee 1
B34Employee 1
C43Employee 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!




LinkedIn Icon
Muhammad Hasnain



@mh2587 

 

I have 2 tables with much more data than show below, just using these as examples.

 

Employee Data

Employee IDEmployee Name
1Employee1
2Employee2

 

Test Data

TestIDEmployee ID
A13 Employee1
B34 Employee1
C43 Employee1
A13 Employee2
D56Employee2
W43Employee3

 

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!




LinkedIn Icon
Muhammad Hasnain



@mh2587 

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

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.