Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I’m trying to create a function that, given a list of string to check (ListToCheck) and a list of target strings (ListTargetStrings), check if the strings to check contain at least one of target Strings.
E.g.:
ListToCheck =
{
“FinancialPart_1”,
”AdditionalFinancialPart”,
”CapexPart”,
”AdditionalValues”,
”SavingsThisYear”,
”CurrentYearSavings”,
”SavingsNextYear”
}
ListTargetStrings =
{
“FinancialPart”,
”Savings”
}
Expected Output =
{
“FinancialPart_1”,
”AdditionalFinancialPart”,
”SavingsThisYear”,
”CurrentYearSavings”,
”SavingsNextYear”
}
Thank you in advance for your help.
Solved! Go to Solution.
Hi @MrDeg
(inputList as list) =>
let
ListTargetStrings_ = {"FinancialPart","Savings"},
output_ = List.Select(inputList,
each List.Accumulate(ListTargetStrings_, false, (state, current) => state or Text.Contains(_, current) ))
in
output_
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Hi @MrDeg
(inputList as list) =>
let
ListTargetStrings_ = {"FinancialPart","Savings"},
output_ = List.Select(inputList,
each List.Accumulate(ListTargetStrings_, false, (state, current) => state or Text.Contains(_, current) ))
in
output_
|
|
Please accept the solution when done and consider giving a thumbs up if posts are helpful. Contact me privately for support with any larger-scale BI needs, tutoring, etc. |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.