Reply
smpa01
Super User
Super User
Partially syndicated - Outbound

Combine each item in list of lists

My source data is following

= {{"A","B"},{"C","D"},{"X","Y","Z"}}

 

From there, I want to land up here

smpa01_0-1635437876832.png

 I can do this by doing following

let
    Source = {{"A","B"},{"C","D"},{"X","Y","Z"}},
    Loop = List.Generate(
                          ()=>[i=0,j=Source{i},k=Text.Combine(j,",")],
                              each [i]<List.Count(Source),
                              each [i=[i]+1,j=Source{i},k=Text.Combine(j,",")],
                              each [k]
    )
in
    Loop

 

Is there any other way to achieve the end goal other than using List.Generate? maybe by using List.Transform?

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION
ronrsnfld
Super User
Super User

Syndicated - Outbound

 

let
    Source = {{"A","B"},{"C","D"},{"X","Y","Z"}},
    combo = List.Transform(Source, each Text.Combine(_,","))
in
    combo

 

ronrsnfld_0-1635444835462.png

 

 

 

View solution in original post

3 REPLIES 3
ronrsnfld
Super User
Super User

Syndicated - Outbound

 

let
    Source = {{"A","B"},{"C","D"},{"X","Y","Z"}},
    combo = List.Transform(Source, each Text.Combine(_,","))
in
    combo

 

ronrsnfld_0-1635444835462.png

 

 

 

Syndicated - Outbound

@ronrsnfld  many thanks. This is awesome !!! appreciate the help.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Syndicated - Outbound

Glad to help. Learning PQ has been a fun experience for me.

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)