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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors