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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
QQQ
Advocate II
Advocate II

Use DISTINCT as filter when calculating SUM

Here is a table

 

Incident_IDTriggersStatus
754571441Red
754571441Green
754588316Purple
754980015Red
754980015Green
754980015Orange

 

Given, there will alway be same number of triggers for a particular ID. But I don't want to count those triggers multiple times.

 

I tried the following DAX. My expected answer is 72, but I get 143 instead. How to fix?

 

Distinct_Matches:=CALCULATE(sum(Incidents[Triggers]),DISTINCT(Incidents[Incident_ID]))

 

1 ACCEPTED SOLUTION
marcorusso
Most Valuable Professional
Most Valuable Professional

If you are sure that Triggers and Incident_ID have a 1:1 relatioship, you could use this:

 

Distinct_Matches :=
SUMX (
    SUMMARIZE ( Incidents, Incidents[Incident_ID], Incidents[Triggers] ),
    Incidents[Triggers]
)

View solution in original post

2 REPLIES 2
marcorusso
Most Valuable Professional
Most Valuable Professional

If you are sure that Triggers and Incident_ID have a 1:1 relatioship, you could use this:

 

Distinct_Matches :=
SUMX (
    SUMMARIZE ( Incidents, Incidents[Incident_ID], Incidents[Triggers] ),
    Incidents[Triggers]
)

@marcorusso Thanks for the quick response!

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors