Forum Discussion
Search a substring in string from another table with DAX
- 3 years ago
Hi Anonymous,
You can try this solution:
However, you may not like some of its drawbacks:
- sorting in Products IDs may not match sorting in Description;
- if you have duplicates in Products IDs, they will have only one match in Description.
If those things don't bother you, it should be fine.
Here's the same calculated column in the text format:
Description = CONCATENATEX ( FILTER ( ADDCOLUMNS ( Table2, "Presence", CONTAINSSTRING ( [Products IDs], [Product ID] ) ), [Presence] = TRUE () ), [Description], ";" )Best Regards,
Alexander
Hi Anonymous,
You can try this solution:
However, you may not like some of its drawbacks:
- sorting in Products IDs may not match sorting in Description;
- if you have duplicates in Products IDs, they will have only one match in Description.
If those things don't bother you, it should be fine.
Here's the same calculated column in the text format:
Description =
CONCATENATEX ( FILTER ( ADDCOLUMNS ( Table2,
"Presence",
CONTAINSSTRING ( [Products IDs], [Product ID] ) ),
[Presence] = TRUE () ),
[Description],
";" )Best Regards,
Alexander
Barritown,
Thanks for this tip it is very usefull but I have a question. I have a situation where I want the result to be the sum of the the values rather than concatenate them. Is that possible?
Thanks