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 )
Not sure i undestand. it looks like you are creating two new columns (Value and Rate Type). what is the 25 after the 50,? I also have about 15 other job titles that i currently have in my IF statement as well.
is there not a way to have conditions on the If statement to say that if the Title equals PE then 50 unless name equals John Doe, then 65 or if name equals Jane Doe then 40?
have to go into a meeting so will not be able to reply for a bit. thanks again for all your help.
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
)
- 95Bigbluetoy6 years agoHelper I
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.