Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe'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
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
Solved! Go to Solution.
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 ""
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"),"*",""))saludos
Phil
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 ""
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.