Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
 
					
				
		
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.
Solved! Go to Solution.
 
					
				
		
CountRepeat = var thisRecord = [key]
RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )
 
					
				
		
CountRepeat = var thisRecord = [key]
RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 84 | |
| 49 | |
| 35 | |
| 31 | |
| 30 |