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.
Hi there,
I have a Country Column with all sorts of weird and wonderful things such as
CÔTE D'IVOIRE |
and
SAINT BARTHÉLEMY |
and I want to remove all the accents etc. I tried Format>Clean but that hasn't helped. Any idea?
Solved! Go to Solution.
Hi heytherejem,
Did you want to het result like below
You could try below M code
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcj48JcRVwSWm1MDAyNwzzN8zyFUpVidayTMvJTMRzAp29PQLUXByDArxONzp4+obqRQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"country name" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"country name", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Select([country name],{"a".."z","A".."Z","0".."9"," "})), #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"country name"}) in #"Removed Columns"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @dax Zoe Zhi, your custom column has removed the letter as well as the special character so not quite what I need. I have used find and replace to get the result I need, but I just feel this is quite manual and you have to have a separate step for each find/replace (urgh).
However your solution will probably work for me in a different situation so it's really useful to see the logic!
Thanks 🙂
Jemma
Hi heytherejem,
Did you want to het result like below
You could try below M code
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcj48JcRVwSWm1MDAyNwzzN8zyFUpVidayTMvJTMRzAp29PQLUXByDArxONzp4+obqRQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"country name" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"country name", type text}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Select([country name],{"a".."z","A".."Z","0".."9"," "})), #"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"country name"}) in #"Removed Columns"
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is a very useful solution, thanks.
Hi @dax Zoe Zhi, your custom column has removed the letter as well as the special character so not quite what I need. I have used find and replace to get the result I need, but I just feel this is quite manual and you have to have a separate step for each find/replace (urgh).
However your solution will probably work for me in a different situation so it's really useful to see the logic!
Thanks 🙂
Jemma
Hi heytherejem,
Thank you for your sharing! If this helps you and if you'd like to, you could mark corresponding post as answer or share your solutions. That way, people who in this forum and have similar issue will benefit from it.
Thanks for your understanding and support.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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 |
---|---|
108 | |
98 | |
78 | |
65 | |
60 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |