Expression help: Check multiple columns using Select and Contains

Doors
New Member

Hi All,

My expression checks if column “Angelfish Blanks” contains the value “1”:

SELECT(Student Dinners[Class], CONTAINS([Angelfish Blanks], “1”,),([Class] = [_THISROW].[Class]))

How would I add two further Columns to the CONTAINS part of the expression? I need to add “Dolphin Blanks” and “Pufferfish Blanks” columns.

Thanks, J.

Solved Solved
0 3 356
1 ACCEPTED SOLUTION

Is this?

SELECT(Student Dinners[Class],
AND(
CONTAINS([Angelfish Blanks], “1”,),
CONTAINS([Dolphin Blanks], “1”,),
CONTAINS([Pufferfish Blanks], “1”,),
[Class] = [_THISROW].[Class]
)
)

Depending on your case and how you want to filter out the row, you change AND expression onto OR,

or you combine AND/OR expression all together.

View solution in original post

3 REPLIES 3

Is this?

SELECT(Student Dinners[Class],
AND(
CONTAINS([Angelfish Blanks], “1”,),
CONTAINS([Dolphin Blanks], “1”,),
CONTAINS([Pufferfish Blanks], “1”,),
[Class] = [_THISROW].[Class]
)
)

Depending on your case and how you want to filter out the row, you change AND expression onto OR,

or you combine AND/OR expression all together.

Doors
New Member

Thats great, Thanks!

Your are welcome.

Top Labels in this Space