Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

IF Statement, Switch statement - Direct Query

I am trying to make a new calculated column or measure (whichever is compatible) in my report. I am running into some issues however do to the data being accessed via Direct Query.   I was initiall...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    We can use CONTAINSSTRING function to meet your requirement.

    We can create a measure like this,

     

    We can create a measure like this,
    Measure = 
    IF(
        CONTAINSSTRING( MAX('Table'[CRQ Success]),"Canceled"),"FAIL",
        IF(
            CONTAINSSTRING(MAX('Table'[CRQ Success]),"Failed*"), "FAIL", "SUCCESS"))

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.