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
Dicken
Continued Contributor
Continued Contributor

Concatenate lists ;


Hi, 
This give the result i want but does anyone have ideas to make more dynamic  or just better approach 
so start = {"A","B","C"}   , result =  {{ "A","C"} , {"A","B"} , {"AC"} , {"AB"} }    

i have ; ;

let
  alist = {"A", "B", "C"},
  pos   = {{0, 2}, {0, 1}}
in
  List.Transform(pos, (x) => List.Transform(x, (y) => alist{y}))
  & List.Transform(pos, (x) => 
                    {Text.Combine(List.Transform(x, (y) => alist{y}), ",")})
1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

let
    Source = {"A", "B", "C"},
    w = List.TransformMany(
        List.Skip(Source), 
        (x) => {x, {x}},
        (x, y) => if y is text then {Source{0} & y} else {Source{0}} & y
    )
in
    w

View solution in original post

5 REPLIES 5
AlienSx
Super User
Super User

let
    Source = {"A", "B", "C"},
    w = List.TransformMany(
        List.Skip(Source), 
        (x) => {x, {x}},
        (x, y) => if y is text then {Source{0} & y} else {Source{0}} & y
    )
in
    w
Dicken
Continued Contributor
Continued Contributor

Thanks i  don't use TransfromMany enough,  

Richard

lbendlin
Super User
Super User

How is this a concatenation of lists?

Dicken
Continued Contributor
Continued Contributor

Ok, you could say mapping, but as I take  { "a","b","c"}  and end up with  { "a,b"}  how is this not 
conctenation? 

It might be a concatenation/permutation of the values in a list but not a concatenation of lists.

 

Maybe a more real world example would have helped to understand the ask (and the reason).

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.