March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I have a column with alphanumerical values identifying the difference between INTERNAL versus EXTERNAL contact.
A | B |
MUST1234 | EXTERNAL |
HAVENO | INTERNAL |
NOHAV12 | EXTERNAL |
MITE1233 | EXTERNAL |
GLAMRO | INTERNAL |
FAMINW | INTERNAL |
I want to create a conditional lookup in Power Query to say IF column “A” contains a number, return External, Other “INTERNAL”.
Solved! Go to Solution.
if List.ContainsAny(Text.ToList([A]), {"1","2","3","4","5","6","7","8","9","0"}) or [A] = "GLAMRO" then "EXTERNAL" else "INTERNAL"
What is I want to make an exception to the rule to capture one or two of the descriptions that does not have a value as part of the description and call it "External".
Example "
A | B |
MUST1234 | EXTERNAL |
HAVENO | INTERNAL |
NOHAV12 | EXTERNAL |
MITE1233 | EXTERNAL |
GLAMRO | External |
FAMINW | INTERNAL |
if List.ContainsAny(Text.ToList([A]), {"1","2","3","4","5","6","7","8","9","0"}) or [A] = "GLAMRO" then "EXTERNAL" else "INTERNAL"
if List.ContainsAny(Text.ToList([A]), {1,2,3,4,5,6,7,8,9,0}) then "EXTERNAL" else "INTERNAL"
I must have missed something in the formula that it's returning an error. Also, the result only returned for "Internal" even though I had values that include a text in the description.
Hi, just add a " " en each number
if List.ContainsAny(Text.ToList([TEXTFIELD]), {"1","2","3","4","5","6","7","8","9","0"}) then "EXTERNAL" else "INTERNAL"
It worked perfect except the error message. The column with the values also had blank rows that was not being picked up by the formula. Is there a workaround?
The formula works also with Blank Rows
I'll try first to made a Trim and Clean to the Column to delete other characters.
Sounds good. one more question. What if I want to create an exception to the rule by picking up a text description from the list.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
197 | |
133 | |
107 | |
69 | |
65 |