Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Replacing Letters with Accents

Hi,

 

I have two lists of names that I want to merge. One list used their names with accents (like é) and the other doesn't. Since having the proper names with the accents isn't super important, I decided to replace all of the accented characters to non accented ones so the merge will work (for example every é to a plain e).

 

Is there a quicker way to do this than doing a replace value for every single instance? Because there's about 12,000 rows.

 

Thanks!

 

1 ACCEPTED SOLUTION
Hauke
Helper I
Helper I

Hey Sean,

 

probably it is more complicated and I just don't get it because of languages reasons: I would just use the "Replace Values..." in the power bi "edit queries mode". Just right click on "René" > Replace Values. You can even choose columns and just replace é to e. 

BR

rené.PNG

View solution in original post

8 REPLIES 8
James0786
New Member

Hi,

If you want to replace letters with accented versions in a word or sentence, you can use a word processor or text editor that supports special characters. In most word processors, you can insert accented characters by holding down the "Alt" key and typing a specific code on the numeric keypad. For example, to insert an é, you can hold down the "Alt" key and type "0233" on the numeric keypad.

Another option is to use a tool that provides a virtual keyboard with accented characters. You can use your mouse to click on the desired accented character, and it will be inserted into your document.

If you want to programmatically replace letters with accented versions in a string, you can use a library or a function that supports character encoding and mapping. For example, in Python, you can use the "unicodedata" library to map characters to their accented versions using the "normalize" and "translate" functions.

Anonymous
Not applicable

Please try this:  https://stackoverflow.com/q/71969831/6165594

 

= (textToConvert) =>
let 
    textBinary = Text.ToBinary  (textToConvert,              1251 ),
    textASCII  = Text.FromBinary(textBinary   , TextEncoding.Ascii)
in    
    textASCII

 

DenisSipchenko_0-1650635522413.png

 

Hello Denis,

 

I was hoping you'd be able to help me

 

Is there a different version of encoding I can use to help me convert the below:

 

From: Rvt Tekstil Konfeksiyon Sanayi Ve Dış Ticaret Ltd Åžti

To: Rvt Tekstil Konfeksiyon Sanayi Ve Dış Ticaret Ltd Şti

 

The target language is Turkish

 

DanielCooper_0-1695918739411.png

Any help you can offer would be greatly appreciated

 

Thank you,

 

Daniel

GlauberCaires
Advocate I
Advocate I

Hello,

You can create a function in powerquery that converts all column. 

Open a blank query e paste this: 

 

(Texto as text) =>
let
    ListAccents = 
		{
		{"à","a"},
		{"á","a"},
		{"â","a"},
		{"ã","a"},
		{"ä","a"},
		{"è","e"},
		{"é","e"},
		{"ê","e"},
		{"ë","e"},
		{"ì","i"},
		{"í","i"},
		{"î","i"},
		{"ï","i"},
		{"ò","o"},
		{"ó","o"},
		{"ô","o"},
		{"õ","o"},
		{"ö","o"},
		{"ù","u"},
		{"ú","u"},
		{"û","u"},
		{"ü","u"},
		{"À","A"},
		{"Á","A"},
		{"Â","A"},
		{"Ã","A"},
		{"Ä","A"},
		{"È","E"},
		{"É","E"},
		{"Ê","E"},
		{"Ë","E"},
		{"Ì","I"},
		{"Í","I"},
		{"Î","I"},
		{"Ò","O"},
		{"Ó","O"},
		{"Ô","O"},
		{"Õ","O"},
		{"Ö","O"},
		{"Ù","U"},
		{"Ú","U"},
		{"Û","U"},
		{"Ü","U"},
		{"ç","c"},
		{"Ç","C"},
		{"ñ","n"},
		{"Ñ","N"}
		}
in
    Text.Combine(List.ReplaceMatchingItems(Text.ToList(Texto), ListAccents))
Anonymous
Not applicable

Anonymous
Not applicable

or this:
https://docs.microsoft.com/en-us/powerquery-m/text-replace 

 

you can use:

New column = Text.Replace([column name] , "á", "a")  

Hauke
Helper I
Helper I

Hey Sean,

 

probably it is more complicated and I just don't get it because of languages reasons: I would just use the "Replace Values..." in the power bi "edit queries mode". Just right click on "René" > Replace Values. You can even choose columns and just replace é to e. 

BR

rené.PNG

Anonymous
Not applicable

Ah thanks! For some reason I thought that replace value only worked if you were replacing the whole value.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors