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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Replace value with new value containing a superscript

Hello,
In Power Query how can I replace a value with a new value containing a superscript.  I need to replace oldName with 

newName+  where the + is a superscript.

Thanks,

1 ACCEPTED SOLUTION
PwerQueryKees
Super User
Super User

Before:

PwerQueryKees_0-1737574979816.png

 

After

PwerQueryKees_1-1737575012230.png

With the formula:

= Table.ReplaceValue(#"Changed Type","+", Character.FromNumber(0x207A),Replacer.ReplaceText,{"Value"})

 

Did I answer your question? Then please mark my post as the solution and make it easier to find for others having a similar problem.
If I helped you, please click on the Thumbs Up to give Kudos.

 

Kees Stolker

A big fan of Power Query and Excel

View solution in original post

5 REPLIES 5
dufoq3
Super User
Super User

HI @Anonymous, what about this?

 

enter TextToReplace

dufoq3_0-1737582348818.png

 

Output

dufoq3_1-1737582378965.png

let
    Source = #table(type table[Value=text], {{"Anything"}, {"Something else"}, {"Another text abc"}}),
    TextToReplace = {"Anything", "text"},
    R = [ a = List.Transform(TextToReplace, Text.Trim),
    b = Record.FromList(List.Transform(a, each _ & "⁺"), a)
  ][b],
    StepBack = Source,
    Ad_Replaced = Table.AddColumn(StepBack, "Replaced", each Text.Combine(List.Transform(Text.Split([Value], " "), (x)=> Record.FieldOrDefault(R, x, x)), " "), type text) 
in
    Ad_Replaced

Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

PwerQueryKees
Super User
Super User

Before:

PwerQueryKees_0-1737574979816.png

 

After

PwerQueryKees_1-1737575012230.png

With the formula:

= Table.ReplaceValue(#"Changed Type","+", Character.FromNumber(0x207A),Replacer.ReplaceText,{"Value"})

 

Did I answer your question? Then please mark my post as the solution and make it easier to find for others having a similar problem.
If I helped you, please click on the Thumbs Up to give Kudos.

 

Kees Stolker

A big fan of Power Query and Excel

Anonymous
Not applicable

Thanks.  Your solution does work.  Staying with your example, assume the starting value is "Anything" rather then "Anything+".  How would you replace "Anything" with "Anything+" (+ is a superscript)?

Table.ReplaceValue(#"Changed Type","Anything+", "Anything" & Character.FromNumber(0x207A),Replacer.ReplaceText,{"Value"})

Pls try

Screenshot_1.png

 

let
    Source = "Anything",
   tab= #table(1, {{Source}}),
    AddCol = Table.AddColumn(tab, "to", each [Column1]&"⁺")
in
    AddCol

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.