Forum Discussion
IF Statement help with multiple variables
- 6 years ago
I started with the dataset below. Because I edited the file it reordered the columns.
[Value] is a Calculated Column.
Adding [RateType] is just a suggestion. You can accomplish what you asked (not adding a helper column) by doing:
Value = SWITCH( TRUE(), 'Table'[Name] = "John Doe" && 'Table'[Title] = "Project Executive", 65, 'Table'[Name] = "Jane Doe" && 'Table'[Title] = "Project Executive", 45, 'Table'[Title] = "Project Executive", 50, 25 )
I started with the dataset below. Because I edited the file it reordered the columns.
[Value] is a Calculated Column.
Adding [RateType] is just a suggestion. You can accomplish what you asked (not adding a helper column) by doing:
Value =
SWITCH(
TRUE(),
'Table'[Name] = "John Doe" && 'Table'[Title] = "Project Executive", 65,
'Table'[Name] = "Jane Doe" && 'Table'[Title] = "Project Executive", 45,
'Table'[Title] = "Project Executive", 50,
25
)
i would be able to add all my other job titles as well in this scenario and therefore would do away with my IF statement, correct?
- 95Bigbluetoy6 years agoHelper I
Thanks for all the help. Using the examples, i was able to create the Switch statement and edit for my various titles. it worked great.
Can't thank everyone enough for the help.