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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Extraer numero de texto

Captura.PNG

Buenos días, necesito extraer los dos últimos caracteres de esta cadena de texto. Intenté hacerlo con el comando DERECHO y me dio, pero el número de los resultados se mantiene como un texto y lo necesito como un número porque debo realizar operaciones con él. Muchas gracias por la atención y ayuda.

 

4 ACCEPTED SOLUTIONS

@Anonymous,

 

You can write an IF ( ) with an ISERROR to only show when there is no error.

Column = 
IF (
    NOT (
        ISERROR (
            VALUE (
                RIGHT ( Table1[Column1], 2 )
            )
        )
    ),
    VALUE (
        RIGHT ( Table1[Column1], 2 )
    )
)

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

Anonymous
Not applicable

Excellent!!!!
Thank you very much for your help. Can I take advantage and ask about a formula to calculate the growth rate?

View solution in original post

Joorge_C
Resolver II
Resolver II

Hola,

En power query intenta:

1-Transforma la columna a Texto (temporalmente)

2-En el Menu>Transform (o Add Column en caso ocupes una columna extra)>Extract  (aqui seleciona los ultimos 2 characteres)

3-Cambiar el formato de las columnas de Texto a Numero

View solution in original post

@Anonymous,

 

You should start another Post as it is not related to this Post.  You should make sure to include sample data that is relevant to your issue.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

14 REPLIES 14
Joorge_C
Resolver II
Resolver II

Hola,

En power query intenta:

1-Transforma la columna a Texto (temporalmente)

2-En el Menu>Transform (o Add Column en caso ocupes una columna extra)>Extract  (aqui seleciona los ultimos 2 characteres)

3-Cambiar el formato de las columnas de Texto a Numero

Anonymous
Not applicable

Thanks Joorge_C
Another solution to what I needed. Thank you very much for your contribution

ChrisMendoza
Resident Rockstar
Resident Rockstar

@Anonymous,

 

Try using VALUE ( ) :

Column = VALUE(RIGHT(Table1[NOCONTENEDOR],2))

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

Captura.PNG

Good morning Chris Mendoza,
Thanks for your attention. It shows #ERROR in the column. Already validate that the number does not have spaces

@Anonymous,

 

My guess is that in your actual data you can't always just take the RIGHT ( ) 2 characters? Possibly you need to take the x characters to the RIGHT of the '-'?

 

Hm, actually I can't reproduce your error.

 

Google Translate says:
you can not convert the 'E' value of the Text type to the tip number

 

My attempt translating to Spanish using Google Translate

Esto significa que tiene un carácter 'E' que se encontró en la DERECHA (), 2






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

 

Captura.PNG

Maybe you're right, I just saw the following:

Anonymous
Not applicable

Thank you. Maybe another way to do it?

try this

column = right([NONCONTENEDOR];2)

and change column type

12.jpg

Anonymous
Not applicable

Nothing, it shows me the same error

@Anonymous,

 

You can write an IF ( ) with an ISERROR to only show when there is no error.

Column = 
IF (
    NOT (
        ISERROR (
            VALUE (
                RIGHT ( Table1[Column1], 2 )
            )
        )
    ),
    VALUE (
        RIGHT ( Table1[Column1], 2 )
    )
)

 






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

Excellent!!!!
Thank you very much for your help. Can I take advantage and ask about a formula to calculate the growth rate?

@Anonymous,

 

You should start another Post as it is not related to this Post.  You should make sure to include sample data that is relevant to your issue.






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



Anonymous
Not applicable

Thanks Chris, I did not understand very well. I am using the translator because I am very bad for English. Thank you for your comments

petrovnikitamai
Resolver V
Resolver V

new column = value(right([NOCONTENDOR];2))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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