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.
i have strings in a column that look like this:
Company NL #496
486 NL for the company
#501 NL
I want to create a new column that just features the 3 digit code. What formula can I use to do this? I'm having trouble with "Text.Select"
Solved! Go to Solution.
Here is the step by step process of achieving it:
1) Go to Transform Data:
2) Now open "Advanced Editor"
3) Now add the M query in your code something as below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLUjMq1Tw81FQNrE0U4rViVYysTAD8dPyixRKMlIVkiFKwFLKpgaGQDml2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"New Column"= Table.AddColumn(#"Changed Type", "New", each Text.Select([Column1], {"0".."9"}))
in
#"New Column"
I hope this will give you some clarity
You can also take the help of this below post:
https://www.excelnaccess.com/extract-numbers-text-only-from-sentences/
Hi @Unicorn_Tech ,
Try this M code in the Power query:
= Table.AddColumn(#"Changed Type", "New", each Text.Select([Column1], {"0".."9"}))
The result will look something like this:
Hi @PC2790 ,
It looks great, but I'm not familiar with M code and power query. I am used to adding columns in existing tables, will this solution work that way?
Here is the step by step process of achieving it:
1) Go to Transform Data:
2) Now open "Advanced Editor"
3) Now add the M query in your code something as below:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs7PLUjMq1Tw81FQNrE0U4rViVYysTAD8dPyixRKMlIVkiFKwFLKpgaGQDml2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"New Column"= Table.AddColumn(#"Changed Type", "New", each Text.Select([Column1], {"0".."9"}))
in
#"New Column"
I hope this will give you some clarity
@Unicorn_Tech , refer extract number from text
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |