Forum Discussion

adinh1's avatar
adinh1
Regular Visitor
3 years ago

Switch statement with fields and not measures

Hi, I am trying to create a switch statement using table fields and and not measaures.

 

Something like:

Category = 
SWITCH(SelectedValue('Table A'[Category] = "Red"),
'Table A'[RedItems], 'Table A'[OtherItems])

4 Replies

    • adinh1's avatar
      adinh1
      Regular Visitor

      Hi Sakiko, thanks for the help, but the problem is that Reditems and Otheritems are actually fields within the same table. (Table A)

      • DataNinja777's avatar
        DataNinja777
        Icon for Super User rankSuper User

        Hi adinh1 

         

        Are Reditems and Otheritems mutually exclusive (i.e., there are no overlaps)?  In that case, why do you need to separate those out in two columns and not combine in one field?