Forum Discussion
Check if substring from column exists inside string in another table column
I have two tables, firstone identifiants, which has id column as below :
second table informations, which has information id column as below:
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.
please what's the solution for that?
Greg_Deckler , correct me if I am wrong but I dont believe Text.Contains will work on its own as it doesnt work with a list of values... ?
Perhaps something like this instead:=Text.Contains(Text.Combine(informations[informations id]),[id])
6 Replies
- Greg_DecklerCommunity Champion
Mourad_Analyst Use Text.Contains
- m_alirezaSolution Specialist
Greg_Deckler , correct me if I am wrong but I dont believe Text.Contains will work on its own as it doesnt work with a list of values... ?
Perhaps something like this instead:=Text.Contains(Text.Combine(informations[informations id]),[id]) - AntrikshSharmaCommunity Champion
Mourad_Analyst Use this:
AddedCustom = Table.AddColumn ( ChangedType, "Custom", ( CurrentRow ) => List.AnyTrue ( List.Transform ( identifiants[ID], (ID)=> Text.Contains ( CurrentRow[information id], ID ) ) ), Logical.Type ) - ImkeFCommunity Champion
Hi Mourad_Analyst ,
to my understanding of the problem, it seems to work alright (as the fields in information id don't seem to match those of the id column.
So maybe my understanding of the problem is incorrect.
Could you please upload sample data in a way so that it can be used to provide a correct answer:https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
Also, please indicate what result exactly you expect for reach row of the sample data.- miguelCommunity Admin
Agreed with this. Please provide some sample data and a sample output as to what you're expecting to accomplish. That will allow us to see things more clearly
- ImkeFCommunity Champion
Hi Mourad_Analyst ,
could you merge the informations table on "information ID" and then instead of expanding the resulting table, add a column with the formula "not Table.IsEmpty[MergedColumnName]".