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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vishnusingh
Frequent Visitor

List to column

Hi Team,

 

I am fetching data from web URL and some data is showing as List. Basically these are IPs. Refer below snap

vishnusingh_0-1657277819475.png

 

Here list is having more than one IP in List.

 

Now I would like to extract these IPs in a column as comma seperated.

 

Any leads on it.

 

Thanks you!

1 ACCEPTED SOLUTION

Hi @vishnusingh ,

 

This:

let
    Source = Table.FromRecords({
    [ip =  "192.168.1.1"],
    [ip = Table.ToList(Table.FromRecords({[ip = "10.168.1.2"],[ip = "10.168.1.3"]}))],
    [ip = "22.168.1.4"]}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each if Type.Is(Value.Type([ip]),type list) then [ip] else {[ip]}),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns" = Table.RemoveColumns(#"Extracted Values",{"ip"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "ip"}})
in
    #"Renamed Columns"

 

Best Regards

Community Support Team _ chenwu 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

6 REPLIES 6
PaulDBrown
Community Champion
Community Champion

There is an option in the ribbon which is "convert to table"





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






vishnusingh
Frequent Visitor

if I click on List I can see below two IPs in List. just want to show the value in column to end user.

vishnusingh_1-1657285353414.png

 

 

Hi @vishnusingh ,

 

Please try this m code:

let
    Source = Table.FromRecords({
    [ip =  "192.168.1.1"],
    [ip = Table.ToList(Table.FromRecords({[ip = "10.168.1.2"],[ip = "10.168.1.3"]}))],
    [ip = "22.168.1.4"]}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each if Type.Is(Value.Type([ip]),type list) then [ip] else {[ip]}),
    #"Expanded Custom" = Table.ExpandListColumn(#"Added Custom", "Custom")
in
    #"Expanded Custom"

 

Result:

vchenwuzmsft_0-1657622288046.png

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

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

Hi @v-chenwuz-msft 

 

We are almost close however we would require these IPs in the same column as comma/semi-colon separated not in a new column.

Hi @vishnusingh ,

 

This:

let
    Source = Table.FromRecords({
    [ip =  "192.168.1.1"],
    [ip = Table.ToList(Table.FromRecords({[ip = "10.168.1.2"],[ip = "10.168.1.3"]}))],
    [ip = "22.168.1.4"]}),
    #"Added Custom" = Table.AddColumn(Source, "Custom", each if Type.Is(Value.Type([ip]),type list) then [ip] else {[ip]}),
    #"Extracted Values" = Table.TransformColumns(#"Added Custom", {"Custom", each Text.Combine(List.Transform(_, Text.From), ","), type text}),
    #"Removed Columns" = Table.RemoveColumns(#"Extracted Values",{"ip"}),
    #"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Custom", "ip"}})
in
    #"Renamed Columns"

 

Best Regards

Community Support Team _ chenwu zhu

 

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

 

PaulDBrown
Community Champion
Community Champion

Sorry, what do you mean by "extract these IPs in a column"? Can you show a depiction of what you are trying to achieve?





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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