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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PowerBI-P
Frequent Visitor

Power Query - Mixed numbers and letters error - help

Hi,

Please help me on this issue.

 

I've changed the Stock Code column to text then used custom columns to created separate columns like text and numbers using below formulas then applied and getting same error. 

 

I didn't understand what is the issue here.

 

PowerBIP_0-1689165487105.png

PowerBIP_1-1689165505664.png

 

=Text. Select([Stock Code],{"a".."z","A".."Z","-"})

= Text. Select([Stock Code],{"0".."9"})

 

Kind regards,

PV

1 ACCEPTED SOLUTION

 

It seems there's something in your code that's making Power Query try to change the data type of your [Stock Code] column to a number.

Can you copy the whole query code from Advanced Editor and paste it into a code window ( </> button) here please?

Feel free to anonymise the connections strings etc.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
BA_Pete
Super User
Super User

Hi @PowerBI-P ,

 

Power Query can't convert this to a number because it ends in the letter "B".

If all of your [Stock Code] values have the same format, it might be easier if you just select your [Stock Code] column, then go to the Transform tab > Split Column > By Digit to Non-Digit.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hi BA_Pete,

 

Thanks for your help.

 

It's not all of same format, only few. I have two files with similar data then one file has done successfully with below formulas but other file couldn't do it. See the example. First, I have changed Stock Code data type to text then split the columns with below formulas.

 

=Text. Select([Stock Code],{"a".."z","A".."Z","-"})

= Text. Select([Stock Code],{"0".."9"})

 

PowerBIP_0-1689237087892.png

not sure, why other file is not working. 

I tried your method as well but didn't work either. Any suggestion after seeing above data.

 

Kind regards,

PV

 

It seems there's something in your code that's making Power Query try to change the data type of your [Stock Code] column to a number.

Can you copy the whole query code from Advanced Editor and paste it into a code window ( </> button) here please?

Feel free to anonymise the connections strings etc.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hi BA_Pete,

 

Thanks you for your help. I have sorted the problem.

 

I have created file from starting then it's working.

 

Kind regards,

PV

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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