Forum Discussion

dw0120's avatar
dw0120
Regular Visitor
5 years ago
Solved

Add on to existing Lookup Value

I have a column made up of a Look up value below...

NewColumn = LOOKUPVALUE('TABLE1'[Column1],'TABLE1'[Column2],TABLE2[Column3])
 
I need to add a If NewColumn is blank then pull from TABLE2[Column4]. How can I add that to the existing column above?
 
  • Hi, dw0120 

     

    Based on your description, I created data to reproduce your scenario.The pbix file is attached in the end.

    Table1:

     

    Table2:

     

    You may create a calculated column as below.

    NewColumn = 
    var _val = LOOKUPVALUE(Table1[Column1],Table1[Column2],Table2[Column3])
    return
    IF(
        ISBLANK(_val),
        LOOKUPVALUE(Table1[Column1],Table1[Column2],Table2[Column4]),
        _val
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 Replies

  • v-alq-msft's avatar
    v-alq-msft
    Community Support

    Hi, dw0120 

     

    Based on your description, I created data to reproduce your scenario.The pbix file is attached in the end.

    Table1:

     

    Table2:

     

    You may create a calculated column as below.

    NewColumn = 
    var _val = LOOKUPVALUE(Table1[Column1],Table1[Column2],Table2[Column3])
    return
    IF(
        ISBLANK(_val),
        LOOKUPVALUE(Table1[Column1],Table1[Column2],Table2[Column4]),
        _val
    )

     

    Result:

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.