We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I'm trying to extract any occurences of text starting with the patter "-W" in a field "Name"
I'm getting an error on record 2
Expression.Error: The 'count' argument is out of range.
Details:
6
If matches on this record is
and the length of "Name" is 24,is my 'try' 'otherwise' not working or wrong?
Thanks in advance.
Solved! Go to Solution.
Hi @a_m_wood, check this
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCknNLchJVQguUQhOTVcwNFDQVQg3NDExA9JBIW6G5uYmCpWpJQol+QpJqQoFRZnJqSlKsTrRSk6picn5eQpBKcj6zC0twJIhqcUlCrrhhkbGJgqJSckpIElTM3MLhdS09Ayl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
Ad_ExtractedW = Table.AddColumn(Source, "Extracted W", each
[ a = List.Combine(List.Transform({"- W", "-W"}, (x)=> Text.PositionOf([Name], x, Occurrence.All))),
b = List.Transform(a, (x)=> Text.BeforeDelimiter(Text.Trim(Text.Range([Name], x), {" ", "-"}), " "))
][b], type list)
in
Ad_ExtractedW
Hi @a_m_wood, check this
Result
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCknNLchJVQguUQhOTVcwNFDQVQg3NDExA9JBIW6G5uYmCpWpJQol+QpJqQoFRZnJqSlKsTrRSk6picn5eQpBKcj6zC0twJIhqcUlCrrhhkbGJgqJSckpIElTM3MLhdS09Ayl2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Name = _t]),
Ad_ExtractedW = Table.AddColumn(Source, "Extracted W", each
[ a = List.Combine(List.Transform({"- W", "-W"}, (x)=> Text.PositionOf([Name], x, Occurrence.All))),
b = List.Transform(a, (x)=> Text.BeforeDelimiter(Text.Trim(Text.Range([Name], x), {" ", "-"}), " "))
][b], type list)
in
Ad_ExtractedW
Thank you!
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 7 | |
| 7 | |
| 6 |