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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Seperate number and text from the lft

Product Column                          Needed new column as 

 288 Ham 20*5g                        Ham 20*5g 

110 Caam 10*5 g                       Caam 10*5 g

220 Ham 25*10g                        Ham 25*10g 

Bun 4" 8*12*5g                           Bun 4" 8*12*5g

SBS 200  20g                               SBS 200  20g

 

 

Thanks for your  help community 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

I would propose Text.PositionOfAny as illustrated in Split column based on text and numerical characters - YouTube

 

Please using the following formula to add a custom column:

 

=Text.PositionOfAny([Product Column],{"A".."Z"})

 

Then add a new column by extracting the original column:

 

=Text.Middle([Product Column], [Custom])

 

After removing other columns, the final output is shown below:

3.8.3.transform.PNG

Here is the whole M formula:

 

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.PositionOfAny([Product Column],{"A".."Z"})),
    #"Inserted Text Range" = Table.AddColumn(#"Added Custom", "New Column", each Text.Middle([Product Column], [Custom]), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Inserted Text Range",{"Product Column", "Custom"})
in
    #"Removed Columns"

 

 

Please take a look at the pbix file.

 

Best Regards,
Eyelyn Qin
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

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

I would propose Text.PositionOfAny as illustrated in Split column based on text and numerical characters - YouTube

 

Please using the following formula to add a custom column:

 

=Text.PositionOfAny([Product Column],{"A".."Z"})

 

Then add a new column by extracting the original column:

 

=Text.Middle([Product Column], [Custom])

 

After removing other columns, the final output is shown below:

3.8.3.transform.PNG

Here is the whole M formula:

 

    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.PositionOfAny([Product Column],{"A".."Z"})),
    #"Inserted Text Range" = Table.AddColumn(#"Added Custom", "New Column", each Text.Middle([Product Column], [Custom]), type text),
    #"Removed Columns" = Table.RemoveColumns(#"Inserted Text Range",{"Product Column", "Custom"})
in
    #"Removed Columns"

 

 

Please take a look at the pbix file.

 

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

Anonymous
Not applicable

Hello,@Anonymous , Thank you for your soution, it worked ,, but  the second  one 

Then add a new column by extracting the original column:

 should me 

=Text.Middle([Product Column],[custom])

 

Thanks again 

 

Anonymous
Not applicable

@Anonymous ,

 

Oh,Sorry for my carelessness!  I have edited the previous reply. Thanks😀

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Thank you @Anonymous  !!!!

amitchandak
Super User
Super User

@Anonymous , Try like this; if first character is text , use Text.Start, if true then Split on first space

Use the code where to check number

https://eriksvensen.wordpress.com/2018/03/06/extraction-of-number-or-text-from-a-column-with-both-text-and-number-powerquery-powerbi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak  , i tried  your suggestion but it gives me  new colunm either only numbers or new column only character along with g.  I would like to remove the number before each product name..... 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors