I am trying to create a column to see if an ID equals another ID with the same month. It should show "NO" but if an ID equals another ID with a different month. It should show "YES". Other show "NO". see as below
ID Month Duplicate
1 4 No
1 4 No
2 5 No
2 6 Yes
2 7 Yes
3 8 No
4 6 No
4 6 No
4 7 Yes
4 8 Yes
5 6 No
5 6 No
5 6 No
My code like this
Duplicate =
IF (
COUNTROWS ( FILTER ( Data, Data[Policy No] = EARLIER( Data[Policy No]) ) )
> 1
&& COUNTROWS ( FILTER ( Data, Data[Month] < EARLIER(Data[Month]) ) ),
"YES",
"NO")
but it is not correct because when I select the first month as month 4 it shows no but when I select month 5 it shows yes. Like as below
ID month Duplicate
1 4 No
1 4 No
2 5 Yes
2 5 Yes
Please help me resolve this Thank you