Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I all I've used Text.Remove([Pol Ref], {"0".."9"}), to quickly remove all numric values from a text string column with no problems.
I wanted to create a similar, type of custom column, this time to check if each row in a column contains A through to Z
So I create another custom column, with the following M code
However the it returns Error on each row for my Postcode column, advising
"Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=List
Type=Type"
I'm rather new to programming, and new to programming in M. Can anyone advise a solution for such a newbie?
Solved! Go to Solution.
Thank you, we hit a error at the "then" section of the M coding
If seems like M does not allow to create conditional formula onto lists?!?
It works when I use some sample data
Take a look at attached Excel file's query editor
Try this revision
=if
List.ContainsAny(Text.ToList([Column1]),{"a".."z"}&{"A".."Z"})
then
"Keep"
else
"Remove"
Thank you, we hit a error at the "then" section of the M coding
If seems like M does not allow to create conditional formula onto lists?!?
It works when I use some sample data
Take a look at attached Excel file's query editor
Thank you, and sorry
I made a mistake with the brackets, it's annoying that Power Query does not give better feedback on issues with my programming.
It now works very well.
Cheers
Mathew
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 47 | |
| 44 |