Forum Discussion
Match values in a column with itself
Anonymous , Something like this
if(countx(filter(Table, [merchant_id] =earlier([merchant_id]) && [Day] =earlier([Day]) && [user_account_id] = earlier([user_account_id])),[id])+0 >1,"Yes","No")
amitchandak : It doesn't seems to work. The two tables in the screenshot are identical tables. I just created a copy of one of the tables.
Yes/No is based on where:
Merchant_Number = Merchant_Number(from 2nd table)
and
date = date(from 2nd table)
and
account_user_id = account_user_id(from 2nd table)
- amitchandak5 years ago
Super User
Anonymous , new column in table 2
if(countx(filter(Table, Table[merchant_id] =(Table2[merchant_id]) && Table[Day] =(Table2[Day]) && Table[user_account_id] = (Table2[user_account_id])),Table[id])+0 >1,"Yes","No")
Refer the way to move value from one table to another https://www.youtube.com/watch?v=czNHt7UXIe8
- Anonymous5 years agoNot applicable
amitchandak : Can you help me in understanding the purpose of Table[id])+0 >1? The id is just some random nos.
- wdx223_Daniel5 years ago
Community Champion
Anonymous in DAX, no need to duplicate the table, just add a calculated column in the original one. the code might be
=COUNTROWS(FILTER(Table,Table[Filed1]=EARLIER(Table[Filed1])&&Table[Filed2]=EARLIER(Table[Filed2])&&Table[Filed1]=EARLIER(Table[Filed2])))
- Anonymous5 years agoNot applicable
Hi Daniel,
The formula will count the no of rows. I want to add a condition that when all the 3 fields macthed are matched then it will update the column to yes otherwise no.
- wdx223_Daniel5 years ago
Community Champion
Anonymous confused why this code did not work.
=IF(COUNTROWS(FILTER(Table,Table[Filed1]=EARLIER(Table[Filed1])&&Table[Filed2]=EARLIER(Table[Filed2])&&Table[Filed3]=EARLIER(Table[Filed3]))),"Yes","No")
could you show the snapshot?