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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
walkery
Helper I
Helper I

If Or Nested Statement with Text Values Getting Error

Hi - I have a column with employee names in it. For a couple of employee names I need their office to be changed to "corporate" rather than their office location. I put together the below test statement to see if I could get it to work with the "||" as an "Or" operator but I am getting an error when I try to add the column into a visualization. The error says: "conversion failed when converting the nvchar value 'user 1' to data type bit...". The employee name column is text formatted so not sure why I'm getting this error which I assume is like a data mismatch? 

 

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] = "User 1" || "User 2","Corporate",rvw_USAOBrokerReferrals[OTerritory])
1 ACCEPTED SOLUTION
Anonymous
Not applicable

@walkery,

you can either use

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] = "User 1" || rvw_USAOBrokerReferrals[OBrokerName] = "User 2","Corporate",rvw_USAOBrokerReferrals[OTerritory])

or 

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] IN {"User 1", "User 2"},"Corporate",rvw_USAOBrokerReferrals[OTerritory])

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@walkery I think the issue is that for every option you should use the column implied on it

 

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] = "User 1" || rvw_USAOBrokerReferrals[OBrokerName] ="User 2","Corporate",rvw_USAOBrokerReferrals[OTerritory]).

 

I'm no 100% sure about, but try it

 

 

Anonymous
Not applicable

@walkery,

you can either use

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] = "User 1" || rvw_USAOBrokerReferrals[OBrokerName] = "User 2","Corporate",rvw_USAOBrokerReferrals[OTerritory])

or 

Column = IF(rvw_USAOBrokerReferrals[OBrokerName] IN {"User 1", "User 2"},"Corporate",rvw_USAOBrokerReferrals[OTerritory])

@Anonymous thanks! That was it. It always is the smallest syntax errors that seems to cause these errors! 🙂 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.