Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Cannot convert string value of type text to True/False

I can't figure out why I am getting this error...

"Cannot convert value 'Group B' of type Text to type True/False" in the example below:

 

Type =
if('Incident Data'[Support Group] = "Apple"
||'Incident Data'[Support Group] = "Orange"
&& not(CONTAINSSTRING('Incident Data'[Template],"Banana"||"Grapes")), "Group A"
,IF('Incident Data'[Support Group] = "Cucumber"
||'Incident Data'[Support Group] = "Tomatoe"
||'Incident Data'[Support Group] = "Broccoli"
&& (CONTAINSSTRING('Incident Data'[Template], "Banana"||"Grapes")),"Group B"))
 
Any ideas?
 

3 Replies

  • bsheffer's avatar
    bsheffer
    Icon for Continued Contributor rankContinued Contributor

    check the type of your measure or calculated field.  It needs to be text

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes, it is Text

       

       

      • bsheffer's avatar
        bsheffer
        Icon for Continued Contributor rankContinued Contributor

        I don't see anything wrong with the type then.  However whenever you use both "ands" and "ors" you need to use parentheses to group the ors together.

         

        'Incident Data'[Support Group] = "Cucumber"
        ||'Incident Data'[Support Group] = "Tomatoe"
        ||'Incident Data'[Support Group] = "Broccoli"
        && (CONTAINSSTRING('Incident Data'[Template]"Banana"||"Grapes"))
         
        should be
        (
        'Incident Data'[Support Group] = "Cucumber"
        ||'Incident Data'[Support Group] = "Tomatoe"
        ||'Incident Data'[Support Group] = "Broccoli"
        )
        && (CONTAINSSTRING('Incident Data'[Template]"Banana"||"Grapes"))