Forum Discussion
Croy
8 years agoRegular Visitor
Add column based on a list from another table
I have 2 tables (which are obtained via two separate queries): - In Details table I have columns like Date, Country, Customer, Text and some other columns - In Products table I have a list of pr...
- 8 years ago
Hi Croy
Try this calculated column in DETAILS table
Calculated Column = CONCATENATEX ( FILTER ( Products, SEARCH ( Products[Products], Details[Text],, 0 ) > 0 ), Products[Products], ", " )
Greg_Deckler
8 years agoCommunity Champion
I'm thinking you will want to use the DAX SEARCH or FIND functions to achieve what you are going after. Perhaps coupled with LOOKUPVALUE as well. Now that I am thinking about it, I don't generally reference other queries from a single query in M in the manner you are describing.
Zubair_Muhammad
8 years agoCommunity Champion
Hi Croy
Try this calculated column in DETAILS table
Calculated Column =
CONCATENATEX (
FILTER ( Products, SEARCH ( Products[Products], Details[Text],, 0 ) > 0 ),
Products[Products],
", "
)- afzalphatan8 years agoResolver I
Croy this formual by zubai should give the result as u suggested
- Croy8 years agoRegular Visitor
Awesome solution Zubair. Many thanks :)
- ysaykin5 years agoNew Member
Hi Zubair, if the text field contains multiple keywords the formula returns multiple categories. Anyway to just get the first one that matches.