Search code examples
excelpowerbipowerquerym

Check if substring from column exists inside string in another table column


I have two tables, firstone identifiants, which has id column as below : enter image description here

second table informations, which has information id column as below:

enter image description here  

I added a custom column check in identifiants table to check if id exists (TRUE) or not (FALSE) in information id column in informations tabe:

but it give me for all ids FALSE even some of them exists in information id.

please what's the solution for that?


Solution

  • try

    =  Text.Contains(Text.Combine(informations[information id]," ") ,Text.From([id]))
    

    EDIT

    try

    let CheckList=List.Combine(Table.AddColumn(informations, "Custom", each Text.SplitAny([information id],"/?!"))[Custom]),
    ...
    #"Added Custom" = Table.AddColumn(#"PriorStepName", "Custom", each if List.Count(List.Select(CheckList, (cat) => Text.EndsWith( cat, [id] )))=0 then false else true)