Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

ExpandRecordColumn only where a specific item

Hello,

 

I have a problem in Power Query

 

I have a table with Record column but want record this column only with specific item in the Record column

 

I need to do this because when made only ExpandRecordColumn, a lot of rows that don't interesting me appears (i want only rows with specific item) and the performance of my query is affected because i filter this item after record column. I want to filter this item when recording to have a performance. 

 

Do you know if it's possible ? 

 

Thank you in advance 

2 Replies

  • dufoq3's avatar
    dufoq3
    Community Champion

    Hi, you can choose what exactly you want to expand. If you need something more, provide sample data in usable format (not a screenshot) and expected result based on sample data please.

     

     

  • 1. Add a new column by converting Record column to a table column.

    2. Add another column to apply filtering with in the table before expand.

    3. Remove actual record column and NewColumnName column.

    4.Expand FilteredRecordColumn for required columns.

    = Table.AddColumn( Source, "NewColumnName", each Record.ToTable([RecordColumn]))
    = Table.AddColumn( Custom1, "FilteredRecordColumn", each Table.SelectRows([NewColumnName],each [id] ="9"))
    = Table.RemoveColumns(Custom2,{"Record Column", "NewColumnName"})

    Please Accept as a solution if it resolves your issue.

    Have a nice day 🙂