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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Metran
New Member

How to convert Table/list into comma separated string

Hi,

I have 2 queries:

1. a [connection only] which is generating a parameter within Power Query from a referrence from within the spreadsheet itself - a list (single column) of numbers as text or integer. let's say this parameter is called "IDlist". 

Metran_1-1694387551937.png

2. a [Web API call] using the = Json.Document(Web.Contents("https://somewebapi.com/" & IDlist)) function. The intent here is to have the IDlist resolve to a string as "34,35,36,37,38,39,40"

 

I've searched the web for a solution but none have turned up yet.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Metran 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi3ApKVSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(#"Changed Type"[ID],","))
in
    #"Added Custom"

Output

vxinruzhumsft_0-1694486104501.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Metran 

You can put the following code to advanced editor in power query

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi3ApKVSbCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", type text}}),
    #"Added Custom" = Table.AddColumn(#"Changed Type", "Custom", each Text.Combine(#"Changed Type"[ID],","))
in
    #"Added Custom"

Output

vxinruzhumsft_0-1694486104501.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

slorin
Super User
Super User

Hi,

 

= """"& Text.Combine(List.Transform(Source[ID], Text.From), ",") & """"

Stéphane 

Syndicate_Admin
Administrator
Administrator

Apologies,

 

Hit send too soon.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.