Forum Discussion
Find Close duplicate (same vendor, same amount, different date within a range)
- Anonymous4 years ago
Hi MarcBlanc
Through your description , if the vendors are same and amounts are same, the date diff is less than or equal to 5 ,then display the first 2 rows only in this case . Is the screenshot below the result you want ?
I create a sample , maybe you can refer to it .
(1)Create a column to return the rank number .
Rank =RANKX(FILTER('Table','Table'[Vendor]=EARLIER('Table'[Vendor])&&'Table'[Amount]=EARLIER('Table'[Amount])),'Table'[Date],,ASC)(2)Create a column to judge whether the diff is in a 5 days range ,if yes ,return 1.
judge = var _date=MAXX(FILTER('Table','Table'[Vendor]=EARLIER('Table'[Vendor]) && 'Table'[Date]<EARLIER('Table'[Date]) ),'Table'[Date]) var _diff=DATEDIFF(_date,'Table'[Date],DAY) return IF(_diff<=5 && _diff<>BLANK(),1,0)(3)Put the column [judge] in card chart ,if it is greater than 0 , set [Rank] is less than or equal to 2 to return the first 2 rows . If the value for [judge] is 0, then there is no time interval within 5 days, and there is no need to filter .
I have attached my pbix file ,you can refer to it .
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi MarcBlanc
I am so glad to hear that the problem has been solved . Then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.