Forum Discussion
PowerBITestingG
Resolver I
4 years agoRank duplicates
Hi all
So using this DAX
duplicate = CALCULATE(COUNTA(column1),ALLEXCEPT(table,column1))
I can get the duplicated values.
What I am trying to do is to label one of the duplicates as 1 and the rest as 0, or just rank them, as long as I get a way to filter unique values
Like:
Column1 Result
AAA 1
AAA 0
BBB 1
BBB 0
BBB 0
Any ideas?
I solved by creating a new calculated column that uses RAND() for breaking ties
rankduplicates =
RANKX (
FILTER (
table,
table[column1]
= EARLIER ( table[column1] )
),
table[notie] -- Just RAND()
)
2 Replies
- tamerj1
Community Champion
Hi PowerBITestingG
What other columns you have? Do you have date or inex column(s)? Can you add index column? In other words how do you define the first record? By time or or index?- PowerBITestingG
Resolver I
I solved by creating a new calculated column that uses RAND() for breaking ties
rankduplicates =
RANKX (
FILTER (
table,
table[column1]
= EARLIER ( table[column1] )
),
table[notie] -- Just RAND()
)