Forum Discussion
Identify Duplicate Values in a Table using a measure
Hello
How can i identify dupplicate values in a table column (Number) using a measure?
Thanks
Gaurav
| Product | Number |
| Drum | 111 |
| Drum | 122 |
| Drum | 123 |
| Drum | 134 |
| Drum | 133 |
| Drum | 133 |
| Glass | 133 |
| Glass | 145 |
| Glass | 134 |
| Plate | 123 |
| Plate | 1234 |
| Glass | 12344 |
| Drum | 12334 |
- Anonymous5 years ago
You don't need a measure for this. You can do it directly using the table visual by counting the "Number" for each product. You can use a table visual in which you add the Product column and Number column twice. The first Number column will be the Number itself and the second Number column will be aggregated by count as shown below. You can then sort or filter by "Count of Number" on anything greater than 1 which indicates a duplicate.
2 Replies
- AnonymousNot applicable
You don't need a measure for this. You can do it directly using the table visual by counting the "Number" for each product. You can use a table visual in which you add the Product column and Number column twice. The first Number column will be the Number itself and the second Number column will be aggregated by count as shown below. You can then sort or filter by "Count of Number" on anything greater than 1 which indicates a duplicate.
- FrankATCommunity Champion
Hi gaurav-narchal ,
you can do it like this:
Dublicate = IF ( CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Number] ) ) = 1, "-", CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[Number] ) ) ) ... in Products = IF ( SEARCH ( ",", CALCULATE ( CONCATENATEX ( VALUES ( 'Table'[Product] ), 'Table'[Product], ", " ), ALLEXCEPT ( 'Table', 'Table'[Number] ) ), 1, 0 ) = 0, "-", CALCULATE ( CONCATENATEX ( VALUES ( 'Table'[Product] ), 'Table'[Product], ", " ), ALLEXCEPT ( 'Table', 'Table'[Number] ) ) )With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)