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 360
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