Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KDTF1023
New Member

Partial text Matches in Nested Lists

Hello, I am hoping to add a custom column in my query that would provide a true/false based on whether lists in a nested list contains a partial text match.  For example, I would like the substring text "Act" to give a true if "F25 Actual" appeared in the nested list. I have tried Text.Contains, List.ContainsAny, which worked with regular lists,  but I am getting errors with the nested list structure that I am not sure how to resolve.

Thank you

5 REPLIES 5
KDTF1023
New Member

Hello and thanks all for responding,

Sample data would be something like this, with an Account Header and then 36 Columns of monthly data for each of F25 Actual, F25 Budget, F24 Actuals

KDTF1023_0-1765734610786.png

After loading into the Editor I used Table.ToColumns to convert columns to lists.  Since the 3rd list, for example, includes "Actual" I'd lke the Custom column to return a TRUE if "Act" is used as the substring text in the transform function.  The list columns for 'F25 Budget' should show FALSE.

KDTF1023_2-1765734827097.png

 

raisurrahman
Helper II
Helper II

@KDTF1023 

It would be helpful if you could share a sample dataset along with the expected output format.

It looks like in your case the column contains Act then true else false, you can create conditional column in power query for an example a similar kind of power query would require to be added .


= if [NestedListColumn] = null then false else

  List.AnyTrue(

      List.Transform(

          List.Combine([NestedListColumn]),

          each Text.Contains(_, "Act", Comparer.OrdinalIgnoreCase)

      )

  )



If you can provide more information then i can write a complete code in here.


Royel
Solution Sage
Solution Sage

Hi @KDTF1023 , it seems like you are dealing with nested lists. To get an answer faster, it will be better for others if you can share a sample file of what you have and what exactly you want to achieve. 

Hi All and thanks for responding,

Sample data would look like this with an Account column and 36 columns of monthly data for each of F25 Actual, F26 Budget, F24 Actuals

KDTF1023_1-1765735679200.png

After loading into the Editor I used Table.ToColumns to convert the columns into Lists.  Since the third column  list, for example, contains "Actual" i would like the Custom column to show TRUE if "Act" is used as the substring text in the transform function.  The column lists that include "Budget" should show FALSE. 

KDTF1023_0-1765735616061.png

 

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.