Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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])
Solved! Go to Solution.
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])
@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
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! 🙂
User | Count |
---|---|
128 | |
108 | |
99 | |
65 | |
62 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |