Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Power BI DAX Function 'SWITCH' does not support comparing values of type True/False

I am getting this error when I try to create a column in Power BI: Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORM...
  • amitchandak's avatar
    5 years ago

    Anonymous , I think the formula is not used correctly

     

    It should be like

    SWITCH(
    TRUE(),
    SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__003_Have_animals_been_supplied_for_Service_Kill_*846fa9d1-9ac6-4663-b4fc-4298487c7406],,0) >0,"Service Kill",
    SEARCH("Yes",'looker_tables lkr_Questionnaire'[02_Animals_Processed__004_Have_animals_been_processed_for_Supplementary_supply_*bd69ebd2-f869-4593-b75d-e9bf0f4a8e4f],,0)>0,"Supplementary Supply"
    SEARCH("1",'looker_tables lkr_Questionnaire'[02_00 002 SSY SKY],,0) >0,"Both"
    )