How to map conditional value using Custom Expression?

How to map conditional value using Custom Expression?

Use case: 1

If you want different value based on choice.

Example: 

Use case: 2

When want to calculate Tax based on Profession and Percentage of Amount.

Example: