Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hi Team,
Because my other queries rely on the old format, I need to remove the tray number (Tray: XXX | |) from the column without creating a new column. It was only because the tray number was recently added without my knowledge that some of the queries were broken.
Solved! Go to Solution.
Hi,
You can achieve this by modifying or adding below line of code in the Power Query Advance editor. This will replace the values in the existing column itself.
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Column1],each if Text.PositionOf([Column1],"||") = -1
then [Column1] else Text.Trim(Text.AfterDelimiter([Column1], "||"))
,Replacer.ReplaceText,{"Column1"})
Below is the sample data and steps.
sample source data:
Final result after adding the replace in Advance Editor:
Complete Advance Editor Code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVjA0MlaK1YlWCilKrFSwNDJUqKlRQBaPiHQ2NzNFVmIAUhIRGaVgYW6mFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Column1],each if Text.PositionOf([Column1],"||") = -1
then [Column1] else Text.Trim(Text.AfterDelimiter([Column1], "||"))
,Replacer.ReplaceText,{"Column1"})
in
#"Replaced Value"
Hope this helps !!
Hi,
You can achieve this by modifying or adding below line of code in the Power Query Advance editor. This will replace the values in the existing column itself.
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Column1],each if Text.PositionOf([Column1],"||") = -1
then [Column1] else Text.Trim(Text.AfterDelimiter([Column1], "||"))
,Replacer.ReplaceText,{"Column1"})
Below is the sample data and steps.
sample source data:
Final result after adding the replace in Advance Editor:
Complete Advance Editor Code:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcnRyVjA0MlaK1YlWCilKrFSwNDJUqKlRQBaPiHQ2NzNFVmIAUhIRGaVgYW6mFBsLAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type",each [Column1],each if Text.PositionOf([Column1],"||") = -1
then [Column1] else Text.Trim(Text.AfterDelimiter([Column1], "||"))
,Replacer.ReplaceText,{"Column1"})
in
#"Replaced Value"
Hope this helps !!
you can always delete the intermediate steps in the last step. or?
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 45 | |
| 16 | |
| 16 |
| User | Count |
|---|---|
| 107 | |
| 105 | |
| 40 | |
| 33 | |
| 25 |