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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
JeroenW
New Member

SelectRows on Dynamic columnname

Hi,

 

I would like to filter rows from a table based on a value in different columns. Here's an example of a table where I want to get the yellow column as extra column (or at least, the yellow column shows if the row must be in the selection);

 

Schermafbeelding 2023-09-05 165141.png

 

So the column with the filter is based on a fiel value...  Not shure if this is possible at all, maybe something like this:

 

= Table.SelectRows(#"Last Step", each [VALUE IN Filtercolumn] = [VALUE IN Filtervalue])

 

Thanx in advance!

1 ACCEPTED SOLUTION
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Use below formula in a custom column

if Table.ColumnNames(Source){List.PositionOf(List.Range(Record.ToList(_),0,3), [Filtervalue])} = [Filtercolumn] then "Yes" else "No"

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Most Valuable Professional
Most Valuable Professional

Use below formula in a custom column

if Table.ColumnNames(Source){List.PositionOf(List.Range(Record.ToList(_),0,3), [Filtervalue])} = [Filtercolumn] then "Yes" else "No"

Thanx! thanx! thanx a lot. Got it working now. Great!

Thanx fot your answer! I get the message that a value of type Record can't be converted to type Table (translated)... Value=[Record] Type=[Type].

I had to change Source to the right language.. sorry, but the result is now 'No' on each row.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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

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.