'Dynamically auto-populate a column (PowerBI)

I'm new to PowerBI and I am trying to create a dynamic column within an imported table within PowerBI that matches a specific column, based on particular requirements.

Example import table ('Import Data'):

Criteria Option1 Option2 Option3
Criteria1 Value11 Value12 Value13
Criteria2 Value21 Value22 Value23
Criteria3 Value31 Value32 Value33

Desired output (with Option 2 selected):

Criteria Option1 Option2 Option3 Selection
Criteria1 Value11 Value12 Value13 Value12
Criteria2 Value21 Value22 Value23 Value22
Criteria3 Value31 Value32 Value33 Value32

I have attempted to create the Selection column and used the following DAX formula:

Selection = 
    SWITCH(SELECTEDVALUE('OtherDataSource'[Options],"NA"),
    "Option1", 'ImportData'[Option1], 
    "Option2", 'ImportData'[Option2],
    "Option3", 'ImportData'[Option3])

I don't get any errors when writing the formula, but the output column is always blank (despite testing that SELECTEDVALUE('OtherDataSource'[Options],"NA")is returning "Option2" when Option 2 is selected). Consequently, I am not able to use the column in any figures.

Any advice is very appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source