Forum Discussion
Switch Value to Text
- 3 years ago
Hello iamthearch,
Ah I see, it's just one table; there's no lookup table. You were close in your measure! Mine is below. The first main difference is the first parameter. I generally just set that to TRUE() because it's more intuitive to me. The second main difference is since you have multiple conditions, you have to combine them with an && into one condition; if you separate them with a comma, the SWITCH function thinks you're trying to move onto the next parameter. It only takes one condition, then the output to return, then another condition, then another output to return, etc.
Score = SWITCH ( TRUE(), Sheet1[I Need] = "Account Access" && Sheet1[Category] = "User Setup", 3, Sheet1[I Need] = "Account Access" && Sheet1[Category] = "Password Reset", 2 -- other values )Please let me know if you that works for you or if you were looking for something different. 😄
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)
People tend to upload to dropbox or google drive, then share a link in their post. 🙂
Here is a link to my sample
- Wilson_3 years agoMemorable Member
Hello iamthearch,
Ah I see, it's just one table; there's no lookup table. You were close in your measure! Mine is below. The first main difference is the first parameter. I generally just set that to TRUE() because it's more intuitive to me. The second main difference is since you have multiple conditions, you have to combine them with an && into one condition; if you separate them with a comma, the SWITCH function thinks you're trying to move onto the next parameter. It only takes one condition, then the output to return, then another condition, then another output to return, etc.
Score = SWITCH ( TRUE(), Sheet1[I Need] = "Account Access" && Sheet1[Category] = "User Setup", 3, Sheet1[I Need] = "Account Access" && Sheet1[Category] = "Password Reset", 2 -- other values )Please let me know if you that works for you or if you were looking for something different. 😄
----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)