Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi
I have the following table that contains everything in one cell!!!
I want to extract the fist & last date entered in that cell and first & last size in the formate of (00/64").
That 4 columns should be added to the original table similar to pic below.
I want to do it using PQ.
Hi, @Anonymous
let
Source = your_table,
delim = {" on ", ". ", ", ", " "},
col =
Table.AddColumn(
Source, "rec",
each
[a =
List.Buffer(
List.Skip(
Splitter.SplitTextByAnyDelimiter(
delim,
QuoteStyle.None
)([Remark])
)
),
b =
[First Size = a{0}?,
First Date = a{1}?,
Last Size = a{List.Count(a) - 2}?,
Last Date = List.Last(a)]][b]
),
expand = Table.ExpandRecordColumn(col, "rec", {"First Size", "First Date", "Last Size", "Last Date"})
in
expand
You can extract the components using Regular Expressions. You can implement Regular Expressions using a Custom Function or, if you are running Power Query in Power BI, you can also use Python or R.
You just need to use the Extract menu under the Add Columns tab, making sure you choose Text store or Text After Delimiters, making sure the parameters include whether to start from the beginning or end of the string.
--Nate
I tried a lot. I couldn't get a clue.
Maybe second eye can.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |