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'm trying to parse out parts of an email message containing certain search terms. I've got it to the point where I've filtered to only those messages that contains the strings I want and have it such that each new line of the email message is in a list in one of the columns. Now, in order to make it more clear in my report about what was found (and the context in which it was found), I'm trying to filter out those lines that do not contain the string that I wanted to find. But I'm having problems filtering the lists in my "Split on Values" columns to only include the (case insensitive) strings I'm trying to find. Ultimately, I want to combine it back into a string column leaving only those lines that contained the string I was trying to return in first place.
(I've tried List.Contains but that only uses exact matches, and can't seem to figure out how to use Text.Contains within a List within a column like this.)
Any help you can provide would be greatly apprecated!
Solved! Go to Solution.
Hello @pelowski
you can surround your custom function like this
let
Source = #table
(
{"Facility"},
{ {"This is a test"}, {"this is fantastic"}, {"Test123"}, {"13:00 am"} }
),
Facility = List.Select
(
Source[Facility], //your custom function goes here
(
listitem
)=>
List.AnyTrue
(
List.Transform
(
{"test","1"}, //words to be searched go here
(
transfrom
)=>
Text.Contains
(
listitem,
transfrom,
Comparer.OrdinalIgnoreCase
)
)
)
)
in
Facility
Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
Hello @pelowski
you can surround your custom function like this
let
Source = #table
(
{"Facility"},
{ {"This is a test"}, {"this is fantastic"}, {"Test123"}, {"13:00 am"} }
),
Facility = List.Select
(
Source[Facility], //your custom function goes here
(
listitem
)=>
List.AnyTrue
(
List.Transform
(
{"test","1"}, //words to be searched go here
(
transfrom
)=>
Text.Contains
(
listitem,
transfrom,
Comparer.OrdinalIgnoreCase
)
)
)
)
in
Facility
Copy paste this code to the advanced editor in a new blank query to see how the solution works. If this solution fits your need, copy and past a part of it and implement it in your query.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy
@Jimmy801, thank you! I got it working with each list within the column. I'll spend some time this afternoon trying to better understand what it's doing.
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.