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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. 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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.