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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Varias cadenas table.replacevalue

Hola

Necesito ayuda para usar en M (editor de consultas) la función replacevalue para varias cadenas. Esto es lo que tengo hasta ahora:

Table.ReplaceValue(Source,each [COLUMN1], each if(
{"String1","StringReplaced1"}
{"String2","StringReplaced2"}
{"String3","StringReplaced3"}
{"String4","StringReplaced4"}
{"String5","StringReplaced5"}
{"String6","StringReplaced6"}
{"String7","StringReplaced7"}
{"String8","StringReplaced8"}
{"String9","StringReplaced9"}
{"String10","StringReplaced10"}
{"String11","StringReplaced11"}
{"String12","StringReplaced12"}
{"String13","StringReplaced13"}
{"String14","StringReplaced14"}
else "N/A")

cristianml_0-1651690397887.png

La idea es reemplazar de una columna específica diferentes cadenas/texto.

Por ejemplo, reemplace "String1" por "StringReplaced1" y así sucesivamente ..

Espero que puedas ayudarme.

Gracias.

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@cristianml ,

Por favor, pruébalo.

Table.ReplaceValue(#"Changed Type", each [COLUMN], 
each if Text.Contains([COLUMN], "String1") then Text.Replace([Custom], "String1", "StringReplaced1")
else if Text.Contains([COLUMN], "String2") then Text.Replace([Custom], "String2", "StringReplaced2")
else if Text.Contains([COLUMN], "String3") then Text.Replace([Custom], "String3", "StringReplaced3")
else if Text.Contains([COLUMN], "String4") then Text.Replace([Custom], "String4", "StringReplaced4")
else if Text.Contains([COLUMN], "String5") then Text.Replace([Custom], "String5", "StringReplaced5")
else if Text.Contains([COLUMN], "String6") then Text.Replace([Custom], "String6", "StringReplaced6")
else if Text.Contains([COLUMN], "String7") then Text.Replace([Custom], "String7", "StringReplaced7")
else if Text.Contains([COLUMN], "String8") then Text.Replace([Custom], "String8", "StringReplaced8")
else if Text.Contains([COLUMN], "String9") then Text.Replace([Custom], "String9", "StringReplaced9")
else if Text.Contains([COLUMN], "String10") then Text.Replace([Custom], "String10", "StringReplaced10")
else if Text.Contains([COLUMN1], "String11") then Text.Replace([Custom], "String11", "StringReplaced11")
else if Text.Contains([COLUMN], "String12") then Text.Replace([Custom], "String12", "StringReplaced12")
else if Text.Contains([COLUMN], "String13") then Text.Replace([Custom], "String13", "StringReplaced13")
else if Text.Contains([COLUMN], "String14") then Text.Replace([Custom], "String14", "StringReplaced14")
else "NA", Replacer.ReplaceText,{"COLUMN"})

vpollymsft_0-1652066133214.png

Si he entendido mal su significado, proporcione más detalles con la salida deseada y su archivo pbix sin información de privacidad.

Saludos

Equipo de apoyo a la comunidad _ Polly

Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.

View solution in original post

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

@cristianml ,

Por favor, pruébalo.

Table.ReplaceValue(#"Changed Type", each [COLUMN], 
each if Text.Contains([COLUMN], "String1") then Text.Replace([Custom], "String1", "StringReplaced1")
else if Text.Contains([COLUMN], "String2") then Text.Replace([Custom], "String2", "StringReplaced2")
else if Text.Contains([COLUMN], "String3") then Text.Replace([Custom], "String3", "StringReplaced3")
else if Text.Contains([COLUMN], "String4") then Text.Replace([Custom], "String4", "StringReplaced4")
else if Text.Contains([COLUMN], "String5") then Text.Replace([Custom], "String5", "StringReplaced5")
else if Text.Contains([COLUMN], "String6") then Text.Replace([Custom], "String6", "StringReplaced6")
else if Text.Contains([COLUMN], "String7") then Text.Replace([Custom], "String7", "StringReplaced7")
else if Text.Contains([COLUMN], "String8") then Text.Replace([Custom], "String8", "StringReplaced8")
else if Text.Contains([COLUMN], "String9") then Text.Replace([Custom], "String9", "StringReplaced9")
else if Text.Contains([COLUMN], "String10") then Text.Replace([Custom], "String10", "StringReplaced10")
else if Text.Contains([COLUMN1], "String11") then Text.Replace([Custom], "String11", "StringReplaced11")
else if Text.Contains([COLUMN], "String12") then Text.Replace([Custom], "String12", "StringReplaced12")
else if Text.Contains([COLUMN], "String13") then Text.Replace([Custom], "String13", "StringReplaced13")
else if Text.Contains([COLUMN], "String14") then Text.Replace([Custom], "String14", "StringReplaced14")
else "NA", Replacer.ReplaceText,{"COLUMN"})

vpollymsft_0-1652066133214.png

Si he entendido mal su significado, proporcione más detalles con la salida deseada y su archivo pbix sin información de privacidad.

Saludos

Equipo de apoyo a la comunidad _ Polly

Si esta publicación ayuda, considere Aceptarla como la solución para ayudar a los otros miembros a encontrarla más rápidamente.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.