Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
81 | |
74 | |
66 |
User | Count |
---|---|
126 | |
106 | |
105 | |
86 | |
72 |