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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Padideh
Regular Visitor

Filter a column dynamicly (its name is changable)

Hello everyone. I want to filter a column in a table "My Data" ( in excel powerquery) but it changes, for example one day its "Name" column and another day I need to filter "Age" Column. I created a table from My  column name as "MyTBL"  that I want to filter them, and import it as a List. imagin always I want filter a column that its name is equal to first record of list ( MyTBL{0} ) how can I put this MyTBL{0} in my filter function? I tried this but it didnt work = Table.SelectRows(#"My Data", each ([MyTBL{0}] = XXXX )) Can you Help Me pls? 😞
1 ACCEPTED SOLUTION
Stachu
Community Champion
Community Champion

very similar to the problem described here:
https://techcommunity.microsoft.com/t5/excel/power-query-select-first-column-for-function-table-sele...

Assuming MyTBL{0} returns the string with the column name, not an actual record type, something like this should work:

 

Table.SelectRows(#"Changed Type", each (Record.Field(_,MyTBL{0}) <> XXXX))

 

(where #"Changed Type" is the name of the previous step)

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

View solution in original post

3 REPLIES 3
Padideh
Regular Visitor

Yes! it works,Thank you for your solution Stachu. @Stachu 

Stachu
Community Champion
Community Champion

Glad to help 🙂 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Stachu
Community Champion
Community Champion

very similar to the problem described here:
https://techcommunity.microsoft.com/t5/excel/power-query-select-first-column-for-function-table-sele...

Assuming MyTBL{0} returns the string with the column name, not an actual record type, something like this should work:

 

Table.SelectRows(#"Changed Type", each (Record.Field(_,MyTBL{0}) <> XXXX))

 

(where #"Changed Type" is the name of the previous step)

 



Did I answer your question? Mark my post as a solution!
Thank you for the kudos 🙂

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors