Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Switch statement - else text value

Hi,   Below Switch statement works for me but I need to include else then the result is a text value.   So If 'powerbi114 cmQualifications'[qualificationId] = 3892 or 4036 or 4038 then Expiry D...
  • Mariusz's avatar
    Mariusz
    6 years ago

    Hi Anonymous 

     

    Sorry, my bad, all your conditions result in number and your else is text.

    You will need to convert all the values you return to text using CONVERT() or FORMAT( 1, "") or return number in ELSE condition

     

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn