Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Use column value with operator IN

Hi all,

 

In order to use a the operator "IN" in a DAX measure I need a list after that operator.

I am trying to use a string stored in my model as a list. How could I convert a string into a list in a measure?

 

The function we want to use: PRODUCT_TABLE[Name] IN Product_List

  • If we use constant values it works : PRODUCT_TABLE[Name] IN {"A";"B";"C"} : OK
  • If we use data from a column it doesn't works : PRODUCT_TABLE[Name] IN Product_List with Product_List = A;B;C from model

 

 

 

 

  • Hi Anonymous,

     

    Have you tried using FIND or Search instead of IN?

     

    FIND(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])

    FIND is case-sensitive.

     

    SEARCH(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])

    This function does not check uppercase and lowercase letters.

3 Replies

  • Hi Anonymous,

     

    Have you tried using FIND or Search instead of IN?

     

    FIND(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])

    FIND is case-sensitive.

     

    SEARCH(<find_text>, <within_text>[, [<start_num>][, <NotFoundValue>]])

    This function does not check uppercase and lowercase letters.

  • Anonymous's avatar
    Anonymous
    Not applicable

    I managed to do what I wanted to. Thank you all 🙂