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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Power Query - Limpieza del inicio de los números de teléfono

Hola a todos

Actualmente estoy haciendo algunos análisis sobre el costo de los números de teléfono a los que llamamos, pero no son los más limpios y necesito eliminar algunos detalles de la parte frontal del número en Power Query, por ejemplo, a veces tengo "9 * 007" o "907" al comienzo de un número de teléfono móvil, que necesita cambiar a "07". ¿Cómo puedo reemplazar los valores en la consulta de potencia, utilizando una fórmula izquierda como he hecho a continuación en DAX?

Number = IF(LEFT('Outbound Calls'[PhoneNumber],4)="9*00",MID('Outbound Calls'[PhoneNumber],4,LEN('Outbound Calls'[PhoneNumber])-3)

,IF(LEFT('Outbound Calls'[PhoneNumber],3)="9**",MID('Outbound Calls'[PhoneNumber],4,LEN('Outbound Calls'[PhoneNumber])-3)

, IF(LEFT('Outbound Calls'[PhoneNumber],3)="900",MID('Outbound Calls'[PhoneNumber],3,LEN('Outbound Calls'[PhoneNumber])-2)

,IF(LEFT('Outbound Calls'[PhoneNumber],2)="9*",MID('Outbound Calls'[PhoneNumber],3,LEN('Outbound Calls'[PhoneNumber])-2)

, IF(LEFT('Outbound Calls'[PhoneNumber],1)="9",MID('Outbound Calls'[PhoneNumber],2,LEN('Outbound Calls'[PhoneNumber])-1),'Outbound Calls'[PhoneNumber])))))

Atentamente

Jordania

1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

@jme1calff

La fórmula de consulta de consulta de energía debe tener este aspecto

if Text.Start('Outbound Calls'[PhoneNumber], 4) á "9*00"

then Text.Middle('Outbound Calls'[PhoneNumber], 4, Text.Length('Outbound Calls'[PhoneNumber])-3)

else if Text.Start('Outbound Calls'[PhoneNumber], 3) á "9**"

then Text.Middle('Outbound Calls'[PhoneNumber], 4, Text.Length('Outbound Calls'[PhoneNumber])-3)

else if Text.Start('Outbound Calls'[PhoneNumber], 3) á "900"

then Text.Middle('Outbound Calls'[PhoneNumber], 3, Text.Length('Outbound Calls'[PhoneNumber])-2)

else if Text.Start('Outbound Calls'[PhoneNumber], 2) á "9*"

then Text.Middle('Outbound Calls'[PhoneNumber], 3, Text.Length('Outbound Calls'[PhoneNumber])-2)

else if Text.Start('Outbound Calls'[PhoneNumber], 1) á "9"

then Text.Middle('Outbound Calls'[PhoneNumber], 2, Text.Length('Outbound Calls'[PhoneNumber])-1)

otra ""

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Hay @jme1calff

Descargue un archivo PBIX de ejemplo con datos y código

Pruebe esto, funciona en los datos de muestra que creé en ese archivo PBIX

= Table.AddColumn(Source, "Custom", each Text.Replace(Text.Replace("*"&Text.Replace("*"&[Phone Num],"*9", ""),"*00","0"),"*",""))

phone-nums.PNG

saludos

Phil

Syndicate_Admin
Administrator
Administrator

@jme1calff

La fórmula de consulta de consulta de energía debe tener este aspecto

if Text.Start('Outbound Calls'[PhoneNumber], 4) á "9*00"

then Text.Middle('Outbound Calls'[PhoneNumber], 4, Text.Length('Outbound Calls'[PhoneNumber])-3)

else if Text.Start('Outbound Calls'[PhoneNumber], 3) á "9**"

then Text.Middle('Outbound Calls'[PhoneNumber], 4, Text.Length('Outbound Calls'[PhoneNumber])-3)

else if Text.Start('Outbound Calls'[PhoneNumber], 3) á "900"

then Text.Middle('Outbound Calls'[PhoneNumber], 3, Text.Length('Outbound Calls'[PhoneNumber])-2)

else if Text.Start('Outbound Calls'[PhoneNumber], 2) á "9*"

then Text.Middle('Outbound Calls'[PhoneNumber], 3, Text.Length('Outbound Calls'[PhoneNumber])-2)

else if Text.Start('Outbound Calls'[PhoneNumber], 1) á "9"

then Text.Middle('Outbound Calls'[PhoneNumber], 2, Text.Length('Outbound Calls'[PhoneNumber])-1)

otra ""

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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

Top Kudoed Authors