J fast
J fast

Reputation: 53

conditional calculation based on values from another column

I have 2 tables

Table 1

enter image description here

Table 2

enter image description here

They are connected by pkg and Item. This results in the following

enter image description here

As you can see from the image "Item" has a mix of "BULK" & "PKG" values.

I want to create a new column that uses the cross reference to bring in new values.

The new table I want would look like this

 **ITEM**  **Value**   **BULK**  **PKG**   **NEW COLUMN**
  135          2                                 1
  136          4                                 3
  35           1          135       35           1
  36           3          136       36           3

The top 2 items on the left are the associated "BULK" values. I want to bring in the PKG value that appears.

Upvotes: 0

Views: 51

Answers (1)

Alexis Olson
Alexis Olson

Reputation: 40204

You can use the same ISBLANK conditional expression as in your other question, but use a lookup instead of just Value.

New Column =
IF(
    ISBLANK( Table1[Bulk] ),
    LOOKUPVALUE( Table1[Value], Table1[BULK], Table1[ITEM] )
    Table1[Value]
)

Note that this will throw an error if you have multiple BULK values corresponding to a single ITEM.

Upvotes: 2

Related Questions