Forum Discussion

elponce's avatar
elponce
Frequent Visitor
8 years ago
Solved

Create a measure with if statetment to filter data

 Hello!

 

I have a column with text data, and I am trying to create a measure with an 'if' statement that I can use to filter that data in 2 categories. I am looking for rows that contain both words "investigation" and "perform", if this is true then "Investigation" otherwise "Action Item". I tried to use the formula below, but I do not fully understand how the function 'CONTAINS' or if there is a better way to do it.

 

Action Item Type = if(CONTAINS(AI_Open,AI_Open[Action Item Note],"perform",AI_Open[Action Item Note],"investigation"),"Investigation","Action Item")

 

Thank you in adavnce for your help,

 

 

  • Anonymous's avatar
    Anonymous
    8 years ago

    elponce,

    Do you right-click on your  table and select "New Column" to apply the above DAX, your formula works in my scenario.


    Regards,

    Lydia

4 Replies