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
juarta
Frequent Visitor

Cambiar tipo de dato a ABC123

Deseo hacer una combinacion pero la columna tiene texto y números, debo de limpiar, recortar colocar en mayuscula y posteriormente hacer la combinacion de datos, la consulta dentro del power query no genera error pero al cargar indica que no puede hacer la cambio del tipo de formato.

 

Hay aforma de pasar el formato número o texto al ABC123 que revise numeros y letras, por que al hacer el limpiar me lo cambia a formato text

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @juarta 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

h1.png

 

You may add a new step with the followind codes to get the data whose format is like 'ABC123'.

= Table.SelectRows(#"Changed Type",each
let 
data = Text.Trim([Data]),
len = Text.Length(data),
flag1 = List.MatchesAll( Text.ToList( Text.Start(data,3) ),each List.Contains({"a".."z","A".."Z"},_)),
flag2 = List.MatchesAll( Text.ToList( Text.End(data,3)  ),each List.Contains({"0".."9"},_))
in
len=6 and flag1 and flag2
)

 

Result:

h2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-alq-msft
Community Support
Community Support

Hi, @juarta 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

h1.png

 

You may add a new step with the followind codes to get the data whose format is like 'ABC123'.

= Table.SelectRows(#"Changed Type",each
let 
data = Text.Trim([Data]),
len = Text.Length(data),
flag1 = List.MatchesAll( Text.ToList( Text.Start(data,3) ),each List.Contains({"a".."z","A".."Z"},_)),
flag2 = List.MatchesAll( Text.ToList( Text.End(data,3)  ),each List.Contains({"0".."9"},_))
in
len=6 and flag1 and flag2
)

 

Result:

h2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jimmy801
Community Champion
Community Champion

Hello @juarta 

 

I don't really get what you need. could you make some example whats your input and what you need to have. In Power Query there are lot of possibilities to check a text, to split, rearrange and unite again

 

Jimmy

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.

Top Solution Authors