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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Dicken
Post Prodigy
Post Prodigy

Filter Table , Column by postion

 

Hi, 

  so filter table ;

   

Table.SelectRows(Source , each ([B] = "A"))

but if I do not know the name of a coliumn, just postion, so I know I need column 2 , so I found the name; 

 ( List.Transform( {1}, 
(A)=> Table.ColumnNames( Source ) {A} ) {0} )

So this is giving me the column name as text, but how to I get into the select rows as a column , Table.Column = a list, 

 List.Transform( 
 Table.Column ( Source , colname ), 
 (A)=> A = "A")

So is there a way to get colname  step which is text into the equivalent of  [ column name]  ? 

 

 

Richard. 

1 ACCEPTED SOLUTION

 

Table.SelectRows(Source, each Record.FieldValues(_){1} = "A")

 

View solution in original post

4 REPLIES 4
Dicken
Post Prodigy
Post Prodigy

I have done a bit more and come up with this; 

 

 (List.Transform( {1}, (A)=> 
Table.ColumnNames( Source){A} ){0})

 

To get column name, then 

 

 Table.SelectRows(Source, each  
List.Contains( {"A"},Record.Field(_, columnName) 
) )

 

If anyone have more ideas pleas let me know. 

 

Richard. 

 

Table.SelectRows(Source, each Record.FieldValues(_){1} = "A")

 

Actually, it's a bit different, and simpler thnks again, 

Richad. 

Thats similar to my updated post exccep i used record.field, thanks anyway, 

 Table.SelectRows(Source, each  
List.Contains( {"A"},Record.Field(_, columnName) 
) )

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.