Forum Discussion

Sam7's avatar
Sam7
Advocate II
4 years ago
Solved

Change Boolean to Wording

UseSwitch = SWITCH(Table1[Column1],TRUE,"Yes",FALSE,"No") 

I have read lots and seen the above. 

 

I can't get the Table1[Column1] section to work with my tables only my measures.

 

I want to change my boolean from True/False to Yes/No.  

Thanks

  • It's telling you, that 'Table1'[Boolean Column] isn't a bool value. 
    Can you check, that it is in fact bool data type?

    Check Power query for Type logical and see if your TRUE, FALSE are italic as so TRUE, FALSE, otherwise it aint bool values 🙂

     

     

7 Replies

  • Sam7's avatar
    Sam7
    Advocate II

    Thanks. 

     

    I still can't select the table and column I want, I get red lines under this when I type it in.  I only get table and column for my measures. 

    • NickolajJessen's avatar
      NickolajJessen
      Solution Sage

      Are you using Allselected as suggested in the screenshot?

      Here is alternative as calculated column. 

      Nb. Measure is still recommended

       

  • Sam7's avatar
    Sam7
    Advocate II

    Thanks for all your help.  I keep getting an error:

    Switch =
    SWITCH(
    SELECTEDVALUE('Table1'[boolean column])
    ,TRUE(),"YES",
    FALSE(),"NO"
    )
     
     
    • NickolajJessen's avatar
      NickolajJessen
      Solution Sage

      It's telling you, that 'Table1'[Boolean Column] isn't a bool value. 
      Can you check, that it is in fact bool data type?

      Check Power query for Type logical and see if your TRUE, FALSE are italic as so TRUE, FALSE, otherwise it aint bool values 🙂