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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
j12499901313r9
New Member

Display number of people with same total.

PersonUnit
Bob1
Bob 1
Tom2
Bill1

My data has a Person column with duplicated names and a Unit column with values. I would like to sum the Unit column by Person and then display the number of people that have any given total. So for the example above 2 people have a total of 2 and 1 person has a total of one. I feel like I'm making this more complicated than necessary. Thanks!

1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

Hi @j12499901313r9 ,

 

Based on the sample and description you provided, Please try code as below to create two measures.

Unit Total by Person = CALCULATE(SUM('Table'[Unit]), ALLEXCEPT('Table','Table'[Person]))
People Count by Unit Total = CALCULATE(COUNTROWS(DISTINCT('Table'[Person])),FILTER('Table','Table'[Unit Total by Person]))

Result is as below.

vweiyan1msft_0-1703654165581.pngvweiyan1msft_1-1703654172546.png

 

Best Regards,
Yulia Yan

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

View solution in original post

3 REPLIES 3
v-weiyan1-msft
Community Support
Community Support

Hi @j12499901313r9 ,

 

Based on the sample and description you provided, Please try code as below to create two measures.

Unit Total by Person = CALCULATE(SUM('Table'[Unit]), ALLEXCEPT('Table','Table'[Person]))
People Count by Unit Total = CALCULATE(COUNTROWS(DISTINCT('Table'[Person])),FILTER('Table','Table'[Unit Total by Person]))

Result is as below.

vweiyan1msft_0-1703654165581.pngvweiyan1msft_1-1703654172546.png

 

Best Regards,
Yulia Yan

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

Jayaselvan
Helper II
Helper II

Hi,

Hope this helps.

People Count by Unit Total =
VAR _Totals = SUMMARIZE(Table, Table[Person], "Total Units", SUM(Table[Unit]))
RETURN
COUNTROWS(
FILTER(_Totals, [Total Units] = SELECTEDVALUE(_Totals[Total Units]))
)

Thank you for the assistance. When I try to use this with the test data, I get an error of "Parameter is not the correct type. Cannot find name '[Total Units]'

j12499901313r9_0-1703157562272.png

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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