Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hello, I want to do something like this:
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Type modifié", "New colonn", each if Text.Contains([colonne1], "xxx") then "x" else if Text.Contains([colonne1], "xxxy") then "x" else if Text.Contains([colonne1], "xxxd") then "x" else if Text.Contains([colonne1], "xxxg") then "x" else null). This code work well. But I have a lot of modalities and I want to use other code like this
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Type modifié", "New colonn", each if Text.Contains([colonne1], "xxxx" or "xxxd" or "xxxg" or "xxxy") then "x" else null). It not working well and I need help to find the right code. Thanks a lot for your help
Solved! Go to Solution.
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Type modifié", "New colonn", each if List.Contains({"xxx","xxxy","xxxd","xxxg"},[colonne1],(x,y)=> Text.Contains(y,x)) then "x" else null)
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Type modifié", "New colonn", each if List.Contains({"xxx","xxxy","xxxd","xxxg"},[colonne1],(x,y)=> Text.Contains(y,x)) then "x" else null)
Your code contains all the right elements, but this is exactly the one that works.
#"Colonne conditionnelle ajoutée" = Table.AddColumn(#"Type modifié", "New colonn", each if List.Contains({"xxx","xxxy","xxxd","xxxg"},[colonne1]) then "x" else null)
I know you used ,(x,y)=> Text.Contains(y,x)) for the explanations. Thank you so much
my code will give a "x" when [colonne1]="2123xxx212" or "zzzxxxydd", as long as it contains any string in the list.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.