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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
mark_carlisle
Advocate IV
Advocate IV

SUMX on a measure not working as intended

I want to be able to calculate the percentage of agents within a team hitting target.

 

Only agents that have a target should be include in the calculation. This is how I would like the data to display in a table format;

 

Level 5.FullNameLevel 6.FullNameClosed Won ReferralsTarget To DateEmployee CountHas TargetTotal Employees With A TargetIs Hitting MTD Target (0/1)Total Employees Hitting Target (0/1)Achieving MTD Target (%)
Manager LRAgent GD4211111100.00%
Manager LRAgent GS111011111100.00%
Manager LRAgent X2 1     
Totals 171231212100.00%

 

In the above example Agent X would not be included in the calculation for Achieving MTD Target (%) as they do not have a target. The columns highlighted in Orange are all measures.

 

My issue is that the measure Total Employees Hitting Target (0/1) is not working as expect. The result of the measures is shown below.

 

Level 5.FullNameLevel 6.FullNameClosed Won ReferralsTarget To DateEmployee CountHas TargetTotal Employees With A TargetIs Hitting MTD Target (0/1)Total Employees Hitting Target (0/1)Achieving MTD Target (%)
Manager LRAgent GD4211111100.00%
Manager LRAgent GS1110111100.00%
Totals 15112121150.00%

 

As can be seen in the columns in Red, Agent GS has 11 Closed Won Referrals to Date and a target of 10 therefore Total Employees Hitting Target (0/1) should be 1 not 0. The DAX for this measure is;

 

 

 

Total Employees Hitting Target (0/1) = 
SUMX( Lineup, [Is Hitting MTD Target (0/1)] )

 

 

 

And as can be seen Is Hitting MTD Target (0/1) is calculating correctly.

 

I have a sample dataset on OneDrive (link below) that reflects what is happening in the real dataset to assist with troubleshooting. I'm at a loss as to why this is not working when I have used SUMX to sum the measures in the past, so any assistance is greatly appreciated.

 

https://1drv.ms/u/s!AkFN9EElJAPfjzFsmSO9zKHXrgAP?e=dLC0t2

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Here's your measure:

    SUMX(
        values( Lineup[Level 6.FullName] ),
        [Is Hitting MTD Target (0/1)]
    )

Best

D

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Here's your measure:

    SUMX(
        values( Lineup[Level 6.FullName] ),
        [Is Hitting MTD Target (0/1)]
    )

Best

D

This one worked.

 

Thank you for the assistance.

Greg_Deckler
Community Champion
Community Champion

Perhaps:

 

Total Employees Hitting Target (0/1) = 
SUMX( FILTER(Lineup,NOT(ISBLANK([Has Target]))), [Is Hitting MTD Target (0/1)] )


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors