Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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. |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.