Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    8 years ago
    CountRepeat = var thisRecord = [key]
    RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable
    CountRepeat = var thisRecord = [key]
    RETURN CALCULATE( countrows('YourTable'), all('YourTable'), 'YourTable'[related] = thisRecord )