Forum Discussion
Automatically assigning a value based on another column value
NicosAcuna well you could do it with a Switch control in Power Automate as you would be just inside the 27 case limit, but it's more work than having a calculated column using multiple If expressions. So your department column would be a choice column then you'd add the following formula to your DeptID calculated column:
=If(Department="HR",1,If(Department="Operations",2,If(Department="Warehouse",3,"")))
etc etc.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- SyedFaizuddinMay 05, 2022Copper Contributor
RobElliott Thank you for this solution! I was able to get this to work finally! I ran into another issue however. Lets say the choice column was multiselect, meaning you could select multiple options. How would I go about adding the points up on the second column?
Below is my example and error I'm getting:
(I have three selectable options and gave them all 2 points each for a total of 6 points. Lets say I were to select "Multiple Users" and "20 Users," that should equal up to 4 points. If I selected all three options from the drop down menu, it would be 6 points. So I have two columns related to this. First column is "Collaboration" and second column is "CollaborationCalculated" which is a Calculated Field. When I add this formula below in the "CollaborationCalculated" column it works until I make the "Collaboration" column to Allow multiple selections. I get the below error which says: "unsupportedFieldTypeError." Is there an IF statement with addition involved to make this work?)
=IF([Collaboration]="Multiple Users",2,
IF([Collaboration]="20 Users",2,
IF([Collaboration]="10 Users",2,"")))
- Cuba_RJOct 11, 2023Copper Contributor
Hi, RobElliott
I have the same problem in this post, but if I have any change in the number of departments or even names I would have to return to this formula and adjust, am I right?
Is there any other solution that would handle variables for Departments?- Rob_ElliottOct 11, 2023Bronze Contributor
Cuba_RJ yes you would have to update it manually, it wouldn't update dynamically.
Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP UK (and classic 1967 Morris Traveller driver)
- Awesome390Dec 19, 2023Copper ContributorThis doesn't work for me I get an error:
Sorry, something went wrong
One or more column references are not allowed, because the columns are defined as a data type that is not supported in formulas.
One column is choice, the other column is my calculated column which puts the text I want. - HugoVitalFeb 28, 2024Copper Contributor
RobElliott I have a list grouped by State and I want to add a Solution ID column that I want to populate a unique ID based on the state selected. This does not seem to be working for me. How can I accomplish? All states have a unique ID # that is 15 numbers long. =IF(State=“AL”,201028145313666,IF(State=“AK”,201028145313777,”)
- Rob_ElliottFeb 28, 2024Bronze Contributor
HugoVital I assume by "Solution ID column" you mean a calculated column. You need to use a formula like this:
=IF(State="AL","201028145313666",IF(State="AK","201028145313777",IF(State="AZ","196745986234901","0")))Rob
Los Gallardos
Microsoft Power Automate Community Super User.
Principal Consultant, SharePoint and Power Platform WSP Global (and classic 1967 Morris Traveller driver)- HugoVitalFeb 28, 2024Copper Contributor
Rob_Elliott I get a message stating “The validation formula can refer to this column and not others.” I am using a Choice column by the way.