Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Dear Community,
image that the cells in a column contain numbers and string like this D:MNHS 70.29 (Free: 40.23).
How can I extract via for example Power query the numbers 70.29 and 40.23 in two different columns, like
Column A Column B
70.29 40.23
Thank you very much for your help.
Follow this pattern,
let
Fx = (txt as text) as list => List.Select(Text.SplitAny(txt,Text.Remove(txt,{"0".."9","."})), each _<>""),
Source = "D:MNHS 70.29 (Free: 40.23)",
#"Extracted Num" = Fx(Source)
in
#"Extracted Num"Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
Hi @Learner22 ,
For this specific example, this will work:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcrHy9fMIVjA30DOyVNBwK0pNtVIwAXKMNZViYwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [text = _t]),
splitByDelim = Table.SplitColumn(Source, "text", Splitter.SplitTextByEachDelimiter({" ("}, QuoteStyle.Csv, false), {"text1", "text2"}),
addT1extract =
Table.AddColumn(
splitByDelim,
"text1extract",
each Text.Select(
[text1],
List.Combine({{"0".."9"}, {"."}})
)
),
addT2extract =
Table.AddColumn(
addT1extract,
"text2extract",
each Text.Select(
[text2],
List.Combine({{"0".."9"}, {"."}})
)
)
in
addT2extract
If all the values in your table aren't in the same format (specifically the presence of " (" space open-bracket) then you'll need to provide some more indicative examples to work with.
Pete
Proud to be a Datanaut!
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 12 | |
| 8 | |
| 7 | |
| 5 | |
| 5 |