Forum Discussion
Gambrinus
8 years agoFrequent Visitor
populate multiple columns
Hi, I have text data that might look like this: A fruit that grow in bunches are banana Red Delicious apples grow on trees Carrots grow in the ground A summer vegtable is corn I've add...
Gambrinus
8 years agoFrequent Visitor
Thanks for the reply Cherry.
What I want, is once I've detemined the type of food in ColumnJ, to populate another column (ColumnX) with a literal for the type of food.
In my two-food-type example, either Var Fruit or Var Vegetable will be populated. I'd like to accomplish this:
If(trim(Fruit)<>"",[ColumnX]="This is a Fruit",If(trim(Vegetable)<>"",[ColumnX]="This is a Vegetable","Unknown"))
So if the Var Fruit has a value, then ColumnX will contain the literal test, otherwise, if Var Vegetable has a value, ColumnX will have different literal text, otherwise ColumnX will have "Unknown"
Thank you.
v-piga-msft
Resident Rockstar
8 years agoHi Gambrinus,
Try this formula below.
Column 2 =
VAR fruit =
LOOKUPVALUE ( 'table'[Fruits], 'table'[Text Data], 'table'[Text Data] )
VAR vege =
LOOKUPVALUE ( 'table'[Vegetables], 'table'[Text Data], 'table'[Text Data] )
RETURN
IF (
vege <> "",
"This is a vegetable",
IF ( fruit <> "", "this is a fruit", "Unknown" )
)
Here is the output.
For more details, you could have a reference of the attachment.
Best Regards,
Cherry