Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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! 🙂
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
89 | |
68 | |
61 |
User | Count |
---|---|
150 | |
120 | |
100 | |
87 | |
68 |