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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Reemplazar texto diferente, valores nulos en una columna con 0

Hola a todos,

Tengo una columna en mi tabla que contiene texto y algunos valores numéricos. No quiero ver ningún texto en esa columna, solo quiero los valores numéricos en esa columna.

El texto de la columna no es el mismo siempre, tengo más de 1000 texto diferente en la columna junto con valores numéricos.

¿Hay alguna manera de reemplazar todo el texto de la columna con "0" y mantener los valores numéricos tal como están?alphanumeric column.jpg

No es eficaz usar la opción de reemplazo o la columna condicional, ya que hay más de 1000 texto diferente y el texto de la columna podría cambiar en el futuro.

Por favor, sugiera si tiene alguna idea.

9 REPLIES 9
v-diye-msft
Community Support
Community Support

Hola @Aswini_C_S

¿Qué resultado espera para las siguientes cadenas? por favor, amablemente elaborado.

.07/2in (0.07? ¿O 7?)
.14/trace (0.14? ¿O 14?)
Trace/0.04 (0.04? O 0?)
T/.10.1 (10.1?)
Aquí está adjuntado el ejemplo amablemente comprobar la salida si desea obtener:
Columna ?
var t á ADDCOLUMNS(ADDCOLUMNS(GENERATESERIES(1,LEN([Precipitation])),"Char",MID([Precipitation],[Value],1)),"IsSymbol",IF(iserror(value([Char])) && [Char] <> ".",TRUE(),FALSE()))
var t1 á ADDCOLUMNS(t,"Group",var v á [Value] return 0+COUNTROWS(FILTER(t,[Value]<-v && [IsSymbol])))
var t2 á SUMMARIZE(t1,[Group],"Nmuber",var g á [Group] return CONCATENATEX(FILTER(t1,[Group]-g && (not [IsSymbol])),[Char],""))
var t3 á ADDCOLUMNS(t2,"ShapeNumber",
var temp á IF(LEN([Nmuber])-LEN(SUBSTITUTE([Nmuber],".",[Nmuber]))>2 && LEFT([Nmuber],1)".", RIGHT([Nmuber],LEN([Nmuber]-1)),[Nmuber])
return if(LEN(SUBSTITUTE(SUBSTITUTE([Nmuber],"0",""".",""))-0,"0",IF(LEFT([Nmuber],1)".","0"&[Nmuber],[Nmuber]))
)
var minGroup á MINX(FILTER(t3,not ISERROR(VALUE([ShapeNumber]))),[Group])
devolver MINX(FILTER(t3,[Group] ? minGroup),[ShapeNumber])

004.PNG

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
Anonymous
Not applicable

Hola @v-he-msft ,

Gracias por su respuesta!

Por favor, encuentre el siguiente resultado que estoy esperando para las siguientes cadenas.

.07/2in (0,07)
.14/trace (0.14)
Trace/0.04 (0)
T/.10.1 (0)

Estoy recibiendo el error "los argumentos en la función generateseries no pueden estar en blanco" cuando estoy intentando usar la fórmula DAX anterior que compartió. Por favor, hágamelo saber si necesito hacer algún cambio.

Generate series function error.jpg

¡Gracias!

Hola @Aswini_C_S

¿Cuál es la columna [PREC_AMOUNT], asegúrese de que la columna está en el tipo de texto.

Si aún así sigues teniendo problemas, la página de ayuda de este establecimiento.

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
parry2k
Super User
Super User

@Aswini_C_S puede ser fácil agregar una columna personalizada con la siguiente expresión y, a continuación, quitar la columna original.

try Number.FromText([Column1]) otherwise 0

Apreciaría Kudos 🙂 si mi solución me ayudara.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hola @parry2k ,

¡Muchas gracias por su respuesta! Funcionó perfecto para texto en las columnas.

Tengo valores alfanuméricos en mi columna.alphanumeric column.jpg

Si tengo valores alfanuméricos (por ejemplo :- 0.69-MM) en la columna, solo tengo que mostrar valores numéricos (0.69) y eliminar text(MM) en la columna. ¿Hay alguna manera de lograrlo?

@Aswini_C_S probar esta expresión en la columna personalizada

Text.Select([Column1], {"0".."9"})

Apreciaría Kudos 🙂 si mi solución me ayudara. Pregunte cualquier cosa Power BI. Reserva una cita para una consulta gratuita en https://www.perytus.com



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hola @parry2k ,

Text.Select([Column1], á"0".." 9"o) me está dando el siguiente resultado.

Los números decimales ahora se convierten en números enteros. Quería verlo como números decimales.

No quiero ver nada después de delimeters(-,/,,(,_). Por ejemplo, si tengo 0.33-5.8R o 1/0.09T o 0.2-0 Zero, sólo quiero ver vaues numéricos (0.33, 1, 0.2) antes de deimeters.

Text Select.jpg

Data type- Decimal Number.jpg

Gracias por su tiempo😊

@Aswini_C_S pegar los datos de muestra con varias combinaciones para ajustar aún más la solución, hay toneladas de combinaciones aquí. No pegue image solo datos en formato de tabla para que pueda copiar y pegar al final.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Por favor, encuentre los siguientes datos de muestra

Precipitación
Rastro
Blanco
1%traza
--
0
*
R/S
.14/trace
0.03/0.7

.07/2in

0.5(0.18)

0,0002/T
T
T/T
T/.10.1
0.17/1.9
Tot Age
0.03/Trace
Trace/0.04
0.006(0.1)
En
0.9/2.5 nieve
--
0.0.0
3/0.0.1
0..00
0,04/mm

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors