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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
alienout
Frequent Visitor

How to sum data in column A , where ID is distinct and for specific value in column B

IDColumn A Column B
110Document
110Document
212Solution
212Solution
212Solution
320Document
320Document
320Document


My table has duplicates. 

how do I sum values in column A, for a "Document" in column B ?
So, the formula returns 30. 

also, looking to count distinct ID's for "document".  Formula returns 2. 

 

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @alienout 
For sum please use a measure :

Sum unique =
CALCULATE(
SUMX(
SUMMARIZE('Table','Table'[ID],"max",MAX('Table'[Column A ])),[max]),FILTER('Table','Table'[Column B]="Document"))
Ritaf1983_0-1710990231230.png

For count:

Count unique =
CALCULATE(
COUNTX(
SUMMARIZE('Table','Table'[ID],"max",MAX('Table'[Column A ])),[max]),FILTER('Table','Table'[Column B]="Document"))
Ritaf1983_1-1710990292960.png

Pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710992383473.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
alienout
Frequent Visitor

Thank you 

@Ashish_Mathur @Ritaf1983 

both solutions are working out for me. 

 

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1710992383473.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ritaf1983
Super User
Super User

Hi @alienout 
For sum please use a measure :

Sum unique =
CALCULATE(
SUMX(
SUMMARIZE('Table','Table'[ID],"max",MAX('Table'[Column A ])),[max]),FILTER('Table','Table'[Column B]="Document"))
Ritaf1983_0-1710990231230.png

For count:

Count unique =
CALCULATE(
COUNTX(
SUMMARIZE('Table','Table'[ID],"max",MAX('Table'[Column A ])),[max]),FILTER('Table','Table'[Column B]="Document"))
Ritaf1983_1-1710990292960.png

Pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.