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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
AlexGT92
Regular Visitor

Select Columns in a nested Table, based on a list of column name

Hello 

I am trying to select few columns in a nested Table. I have defined the columns name to be selected in a list in a previous step.

I tried Select.Columns and List.Contains but because the data is in a nested column the formulas dont work.

 

here is the code I have at the moment

=Table.AddColumn(PreviousStep, "SelectColumn", each List.Contains(ListColumn,[NestedTableColumn])=true)

 

Could you please help me on this ?

6 REPLIES 6
Galvafan
Frequent Visitor

hi guys sb found a solution? I have similar problem. I tried below but not working.

= Table.TransformColumns(previous_step, {"Skip", each _fx_SelecionaColunas([Skip], [ColNames])})

((((_fx_SelecionaColunas))) =
(tbl as table, col_with_list as list) =>
let  selected_columns = Table.SelectColumns(tbl, col_with_list)  in selected_columns Captura de tela 2024-12-13 092602.png

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Galvafan
Frequent Visitor

hi guys sb found a solution? I have similar problem. I tried below but not working.

= Table.TransformColumns(previous_step, {"Skip", each _fx_SelecionaColunas([Skip], [ColNames])})

((((_fx_SelecionaColunas))) =
(tbl as table, col_with_list as list) =>
let  selected_columns = Table.SelectColumns(tbl, col_with_list)  in selected_columns Captura de tela 2024-12-13 092602.png

lbendlin
Super User
Super User

your code is missing a few bits and pieces.  What exactly are you planning to put into "SelectColumn" ?  a single column value, or a collection of columns?

Hi, Select Column is the new table name where I have some of the columns from the previous step. I would like to select few of the columns from the previous table. And this selection should be based on a list (with column names).

Please provide sanitized sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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