The use case is that I have a form where a user will choose red, blue, or green in the “COLOR SELECTION FIELD”.
I have a field (as shown below) that will return all columns from another table when that selection above is found in the “COLORS” column for that other table.
FILTER(“TABLE”, ([COLOR SELECTION] = [COLORS] ))
What I want is FILTER ROWS WHERE COLOR SELECTION IS CONTAINED WITHIN COLORS and also to choose the columns if possible.
The COLORS field is not an exact match to COLOR SELECTION…more like tags where it can have yellow, green, blue (comma separated). I want all COLORS column values where COLOR SELECTION = “Blue” for example, whether exact match or if “Blue” is simply found in the COLORS value ( yellow, green, blue for example).
Solved! Go to Solution.
Hi @Sam87
What about:
FILTER(“TABLE”,
CONTAINS([COLORS], [_THISROW].[COLOR SELECTION])
)
For reference:
Hi @Sam87
What about:
FILTER(“TABLE”,
CONTAINS([COLORS], [_THISROW].[COLOR SELECTION])
)
For reference:
Thanks,
I used this and it works great!
FILTER(“TABLE”,
CONTAINS([COLORS], [_THISROW].[COLOR SELECTION])
)
I decided to just return one column from the lookup table based on the contains.
I used SELECT(COLORSTABLE[RETURN COLUMN], CONTAINS([COLORS], [_THISROW].[COLOR SELECTION])
)
For some reason the whole table is being returned (with the proper contains result) rather than just the return column. Any thoughts?
You may want to share a screenshot in order to help us better understand what you describe, as well as a screenshot of your table structure.
If the data being searched is a simple textual value, CONTAINS()
is the correct choice.
I am good with this, works. It works great now with contains…but my alternate formula to just pull one column from the table on the match isn’t working. It returns all columns:
SELECT(COLORSTABLE[RETURN COLUMN], CONTAINS([COLORS], [_THISROW].[COLOR SELECTION])
)
The good row but all the columns ? ==> that makes me think:
Can you provide screenshot in order to confirm/deny this ?
This returns all columns rather than just the ‘Reason for PR Failure’ column
SELECT(SystemFix[Reason for Failure], CONTAINS([Tags],[Field of concern]))
Note: This expression could impact performance.
The list of values of column ‘Reason for PR Failure’
…from rows of table ‘SystemFix’
…where this condition is true: ((The value of column ‘Tags’) contains the text value (The value of column ‘Field of concern’))
I was interested in a screenshot of the output too, sorry for not having been clear.
I think you don’t display every necessary information, as the SELECT expression in your last post is not visible in the screenshot provided.
Also, a SELECT returns a list. a Text type is not appropriate, you might want to change it to a List type.
User | Count |
---|---|
15 | |
11 | |
11 | |
8 | |
3 |