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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
JW_van_Holst
Resolver IV
Resolver IV

Add element to list in a list of list

I want to add 4 to the list {5,6} and keep the others elements (lists) of the (outer) list

Source = {{1,2,3}, {5,6}, {12,13}}

//JW

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @JW_van_Holst 

Place the following M code in a blank query to see the steps.

let
Source = {{1,2,3}, {5,6}, {12,13}},
res_ = List.Transform(Source, each if _ = {5,6} then _ & {4} else _)
in
res_

SU18_powerbi_badge

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.

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @JW_van_Holst 

Place the following M code in a blank query to see the steps.

let
Source = {{1,2,3}, {5,6}, {12,13}},
res_ = List.Transform(Source, each if _ = {5,6} then _ & {4} else _)
in
res_

SU18_powerbi_badge

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.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.