Reputation: 625
How do I count repeating ID? I want to put it on the new column, it really doesn't matter if the number of total is repeating example like (if out come is this then better):
==========|=
10327 |2
10327 |2
10328 |3
10328 |3
10328 |3
Upvotes: 3
Views: 23216
Reputation: 63699
Use a calculated column like this:
NrOfOccurrences = CALCULATE(
COUNT([OrderID]);
FILTER(Orders; [OrderID] = EARLIER('Orders'[OrderID])))
From bottom to top:
FILTER
gives you a table per row that has all rows with the same OrderID
COUNT
would count the number of OrderID
s, effectively the number of rowsCALCULATE
puts them together, so that the number of rows in the relevant FILTER
table is counted;For example this is a screenshot of a manually entered table:
Upvotes: 6