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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Counting matching duplicates from another column

I can't figure out a way to calculate the repeat of an ID based on a key column.

 

For example

key       |    related   | count

a0001   |    (blank)   |    3

a0002   |   a0004     |   0

a0003   |   a0004     |   0

a0004   |   (blank)    |   2

a0005   |   a0001     |   0

a0006   |   a0001     |   0

a0007   |   a0001     |   0

 

Trying to figure out the count of the related repeats based on the key.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

CountRepeat = var thisRecord = [key]
RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )

View solution in original post

1 REPLY 1
Anonymous
Not applicable

CountRepeat = var thisRecord = [key]
RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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