Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
_Aleksa_
Helper II
Helper II

Error when using switch function

Hello,

 

Thank you for your help in advance! I am getting the following error message:

 

Error.PNG

1 ACCEPTED SOLUTION
MartynRamsden
Solution Sage
Solution Sage

Hi @_Aleksa_ ,

You're seeing this error because RIGHT is a text function and you're comparing its result to a number.

To fix this, simply put the number 2 in double quotes (i.e. "2") or wrap the entire RIGHT function with VALUE.

Best regards,
Martyn

View solution in original post

1 REPLY 1
MartynRamsden
Solution Sage
Solution Sage

Hi @_Aleksa_ ,

You're seeing this error because RIGHT is a text function and you're comparing its result to a number.

To fix this, simply put the number 2 in double quotes (i.e. "2") or wrap the entire RIGHT function with VALUE.

Best regards,
Martyn

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.