Forum Discussion
Anonymous
4 years agoNot applicable
Detect number in a text string
I want a true/false statement in Power Query to detect numbers in a text string. 45a- TRUE ab- FALSE 34- TRUE aa46- TRUE
- 4 years ago
Hi Anonymous ,
Text.contails could not work on more then one values, similar error refer:
And change yours to the below:
if Text.Contains([Product], "1") or Text.Contains([Product], "2") or Text.Contains([Product], "3") or Text.Contains([Product], "4") or Text.Contains([Product], "5") or Text.Contains([Product], "6") or Text.Contains([Product], "7") or Text.Contains([Product], "8") or Text.Contains([Product], "9") or Text.Contains([Product], "0") then "True" else "False"Did I answer your question? Mark my post as a solution!
Best RegardsLucien
v-luwang-msft
4 years agoCommunity Support
Hi Anonymous ,
Text.contails could not work on more then one values, similar error refer:
And change yours to the below:
if Text.Contains([Product], "1") or Text.Contains([Product], "2") or Text.Contains([Product], "3") or Text.Contains([Product], "4") or Text.Contains([Product], "5") or Text.Contains([Product], "6") or Text.Contains([Product], "7") or Text.Contains([Product], "8") or Text.Contains([Product], "9") or Text.Contains([Product], "0") then "True" else "False"
Did I answer your question? Mark my post as a solution!
Best Regards
Lucien
- PaulDBrown4 years agoCommunity Champion
Using the "Contains" option in the conditional column interface seems to work for me:
Attached is the file
- v-luwang-msft4 years agoCommunity Support
Hi PaulDBrown ,
Thank you for your reply, based on what you have provided, each time you use Contains, you also judge only one element and then use a combination of multiple judgments to get the final result.
Best Regards
Lucien