Forum Discussion
SEARCH function using another column to find value in text string
- Anonymous2 years ago
Hi nmoriello ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
Customer table:
Table:
(2)We can create a new table.
Table 2 = var tmp=CROSSJOIN('Table',Customer) var tmp1=ADDCOLUMNS(tmp,"Flag",CONTAINSSTRINGEXACT([TranGLC_GLAcctContext],[Customer Name])) var tmp2=FILTER(tmp1,[Flag]=TRUE()) var tmp3=SELECTCOLUMNS(tmp2,"Customer Name",[Customer Name]) return tmp3(3)Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi nmoriello ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a calculated column.
Column = IF(CONTAINSSTRINGEXACT([TranGLC_GLAcctContext],[Customer Name])=TRUE(),"Match","No Match")
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
This Match would work fine but my issue is that every line is different. For example, below are some examples of what i am seeing in my TranGLC_GLAcctContext column, the highlighted portion are customer names that I want to extract from that field and then match up with a corresponding customer name on my "Customer" table. For example that first line would extract the "GUNARAMA WHOLESALE, INC" then match it up to my "Customer" table and spit out a column with any matching customer names.
Within excel I was able to do this by using this logic:
INDEX('Customer'!$A$2:$A$2020,MATCH(TRUE,ISNUMBER(SEARCH('Customer'!$A$2:$A$2020,Table1[TranGLC_GLAcctContext]])),0))
I would like to basically recreate this logic with a DAX measure.
- Anonymous2 years agoNot applicable
Hi nmoriello ,
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
Customer table:
Table:
(2)We can create a new table.
Table 2 = var tmp=CROSSJOIN('Table',Customer) var tmp1=ADDCOLUMNS(tmp,"Flag",CONTAINSSTRINGEXACT([TranGLC_GLAcctContext],[Customer Name])) var tmp2=FILTER(tmp1,[Flag]=TRUE()) var tmp3=SELECTCOLUMNS(tmp2,"Customer Name",[Customer Name]) return tmp3(3)Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.