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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AliceW
Power Participant
Power Participant

Measure: SUM that is conditional based on a value in another column

Hi guys,

 

Sounds simple, yet it's complicated. Any help will be very much appreciated.

 

So, I have this table where the total is the problem:

 

Opp ID      Rep Name     Amount

1                Trevor           100

1                John              100

2                Alex               50

TOTAL                             250 

 

Now, notice that Opp ID 1 is present twice, as the field Rep Name is different. 

 

I'd like to have the Total Amount taking into account Opp ID 1 only once; in this example, I'd like the total to be 150 instead of 250.

 

Any thoughts on how to proceed, please?

 

Thanks in advance,

 

Alice

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@AliceW

You've provided very limited sample data and have not specified what the outcome should be if the Amount is different for the same Opp Id so I decided to go with AVERAGE...

Measure =
SUMX (
    SUMMARIZE ( 'Table', 'Table'[Opp ID], "Amt", AVERAGE ( 'Table'[Amount] ) ),
    [Amt]
)

This should give you the average per Opp ID in case the amounts are different. (and we'll use this number in calculating the total)

Obviously you can change to MAX or MIN depending on your actual requirements and data.

 

Hope this helps! Smiley Happy

View solution in original post

2 REPLIES 2
Sean
Community Champion
Community Champion

@AliceW

You've provided very limited sample data and have not specified what the outcome should be if the Amount is different for the same Opp Id so I decided to go with AVERAGE...

Measure =
SUMX (
    SUMMARIZE ( 'Table', 'Table'[Opp ID], "Amt", AVERAGE ( 'Table'[Amount] ) ),
    [Amt]
)

This should give you the average per Opp ID in case the amounts are different. (and we'll use this number in calculating the total)

Obviously you can change to MAX or MIN depending on your actual requirements and data.

 

Hope this helps! Smiley Happy

AliceW
Power Participant
Power Participant

Thanks, Sean! Yes, the Opp amount should be the same, but I'll add MAX just to be on the safe side. Thanks again!!

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.

Top Solution Authors