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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
CharlotteCity12
Microsoft Employee
Microsoft Employee

Create two columns from one column breaking out numbers from text

Working with a data set where one column consists with either number or text ( see below). How can I separate the text from number in different column? I have tried “column example” /changing data type and several other ways but still can’t figure this one out. Any help will be appreciated. Thanks in advance.

 

Current Data

Concentration/Null Code

1.08

0.9

0.6

AN

5

AF

 

Desire Data:

Concentration/Null Code                           Concentration          Null Code

1.08                                                         1.08

0.9                                                           0.9

0.6                                                           0.6

AN                                                                                            AN

5                                                              5                             

AF                                                                                            AF

0.2                                                           0.2                                                                                          

---------------------------------------------------------------------------------------------------------

2 ACCEPTED SOLUTIONS
Vera_33
Resident Rockstar
Resident Rockstar

Hi @CharlotteCity12 

 

How about adding columns instead?

 

Vera_33_0-1634825039827.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzsFCK1YlWMtCzhNJmYNrRD0yZQjhuSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Concentration/Null Code" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Concentration", each try Number.From([#"Concentration/Null Code"]) otherwise null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Null Code", each if [Concentration] = null then [#"Concentration/Null Code"] else null)
in
    #"Added Custom1"

 

View solution in original post

CharlotteCity12
Microsoft Employee
Microsoft Employee

Thank you @Vera_33 This worked perfectly. 

View solution in original post

2 REPLIES 2
CharlotteCity12
Microsoft Employee
Microsoft Employee

Thank you @Vera_33 This worked perfectly. 

Vera_33
Resident Rockstar
Resident Rockstar

Hi @CharlotteCity12 

 

How about adding columns instead?

 

Vera_33_0-1634825039827.png

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMtQzsFCK1YlWMtCzhNJmYNrRD0yZQjhuSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Concentration/Null Code" = _t]),
    #"Added Custom" = Table.AddColumn(Source, "Concentration", each try Number.From([#"Concentration/Null Code"]) otherwise null),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Null Code", each if [Concentration] = null then [#"Concentration/Null Code"] else null)
in
    #"Added Custom1"

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.