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

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.

Reply
Anonymous
Not applicable

Calculate average in a matrix table

Hi all,

 

I am calculate a average value in a matrix table. Every worker has record, 1 or 0(Column 0 or 1). If there is any record not 0, it count 1(Column Max of 0 or 1). What I want is average as showing in the picture. I spent a lot of time to write a measure, but it is always wrong. Really need help!!

Thank you in advance!

Bran

 

Average =
VAR _count =
    ISINSCOPE ( 'Test'[Name] )
VAR _MAX = if(max('Test'[0 or 1])=1,1,0)
RETURN
    IF (
        _count,
        MAX ( 'Test'[0 or 1]),
           
            DIVIDE(calculate(COUNT('Test'[Name]),_MAX=1),distinctcount('Test'[Name]))
       )

 

 

Screenshot 2022-07-28 111222.png

Job DescName 0 or 1
ForemanAllan Doole0
ForemanAllan Doole0
ForemanAllan Doole0
ForemanAllan Doole0
ForemanAllan Doole0
ForemanBen Ju1
ForemanBen Ju0
ForemanBen Ju1
ForemanBen Ju1
Project ManagerAndy Young1
Project ManagerAndy Young0
Project ManagerAndy Young0
Project ManagerAndy Young0
Project ManagerCraig Thorsen0
Project ManagerCraig Thorsen0
Project ManagerCraig Thorsen0
Project ManagerCraig Thorsen0
Project ManagerCraig Thorsen0
Safety CoordinatorAbednego Shu1
Safety CoordinatorAbednego Shu0
Safety CoordinatorAbednego Shu0
Safety CoordinatorAbednego Shu0
Safety CoordinatorAbednego Shu0
Safety CoordinatorAbednego Shu0
Safety CoordinatorAndrew Hadley0
Safety CoordinatorAndrew Hadley1
Safety CoordinatorAndrew Hadley1
Safety CoordinatorAndrew Hadley0
Safety CoordinatorAndrew Hadley0

 

 

 

 

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

 

Average =
AVERAGEX (
    VALUES ( 'Test'[Name] ),
    CALCULATE ( MAX ( 'Test'[0 or 1] ) )
)

 

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @Anonymous 
Please try

 

Average =
AVERAGEX (
    VALUES ( 'Test'[Name] ),
    CALCULATE ( MAX ( 'Test'[0 or 1] ) )
)

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.