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
jcastr02
Post Prodigy
Post Prodigy

Summing with distinct values

how can i get a sum of all values of three columns (minor, major, critical) but only distinct values based on the ID column.  My data has repeating rows and I can't remove because I'm using other fields value.   (ex. since ID 14 is repeating, we would only count that once)

 

IDMinor TotalMajor TotalCritical Total
12210
10021
111110
13333
14401
14401
15500
14401
14401

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jcastr02 , Create measure like this for all three columns

 

sumx(summarize(Table,Table[ID], Table[Minor Total]),[Minor Total])

 

sumx(summarize(Table,Table[ID], Table[Major Total]),[Major Total])

 

sumx(summarize(Table,Table[ID], Table[Critical Total]),[Critical Total])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
v-jingzhang
Community Support
Community Support

@jcastr02 

Try Amit's codes and add up all of them into a measure like below, this should work.

Measure = sumx(summarize('Table','Table'[ID], 'Table'[Minor Total]),[Minor Total]) + sumx(summarize('Table','Table'[ID], 'Table'[Major Total]),[Major Total]) + sumx(summarize('Table','Table'[ID], 'Table'[Critical Total]),[Critical Total])

You can also try this measure:

Measure 2 = SUMX(SUMMARIZE('Table','Table'[ID],'Table'[Minor Total],'Table'[Major Total],'Table'[Critical Total]),'Table'[Minor Total]+'Table'[Major Total]+'Table'[Critical Total])

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

mhossain
Solution Sage
Solution Sage

@jcastr02 

 

In adition to @amitchandak  's dax, you can also try below measure:

DistinctCount based on 3 cols =
CALCULATE(DISTINCTCOUNT('Table'[ID]) , 'Table'[Minor Total]>0)
+
CALCULATE(DISTINCTCOUNT('Table'[ID]) , 'Table'[Major Total]>0)
+
CALCULATE(DISTINCTCOUNT('Table'[ID]) , 'Table'[Critical Total]>0)
amitchandak
Super User
Super User

@jcastr02 , Create measure like this for all three columns

 

sumx(summarize(Table,Table[ID], Table[Minor Total]),[Minor Total])

 

sumx(summarize(Table,Table[ID], Table[Major Total]),[Major Total])

 

sumx(summarize(Table,Table[ID], Table[Critical Total]),[Critical Total])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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