Forum Discussion

deepu299's avatar
deepu299
Advocate V
6 years ago

Using IN Operator with List of Values

Hi, 

 

I am trying to write a DAX function using IN operator. The problem is, I have the list of values which goes between {} are in another table. So I am trying to bring in those values to use in the IN operator. I see the contenateX function is bringing all the values like a list, but they don't work when used with IN. Can someone please help?

 

VAR _List = CONCATENATEX(FILTER('Static Table', 'Static Table'[Type]= "DIVISION"),CONCATENATE( CONCATENATE("""",'Static Table'[Value]), """"), ",")    /* this is giving me values like "Div1", "Div2", "Div3" */

RETURN
SWITCH(TRUE(),
'Employee'[Division] IN {_List}, "Y", "N")

4 Replies