Forum Discussion

wadda7's avatar
wadda7
Helper I
4 years ago
Solved

HELP IN LOOKUPVALUE

Hi everyone    I need your help how to wite guery with lookupvalue or other fuction to update cloumn from anther table    Table 1 allitems  itemid name 01 T-shirt 02 Short Table ...
  • edhans's avatar
    4 years ago

    Hi wadda7 - you can use LOOKUPVALUE(), but I suggest the below is faster.

    Category = 
    MAXX(
        RELATEDTABLE('Inventory Transactions'),
        'Inventory Transactions'[category]
    )

    MAXX (or MAX) simply convert a table of the same value to one scalar value, so think of it like FIRST.

    However, LOOKUPVALUE is this:

    Category 2 = 
    LOOKUPVALUE(
        'Inventory Transactions'[category],
        'Inventory Transactions'[itemid],
        'All Items'[itemid]
    )

    My PBIX is here if you want to review.