Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Comparing 2 columns from same table to another table

New to Power BI

 

This seems very easy but I can not figure out.

I have 2 tables A and B       I can not relate them.   I  need to add column "Lookup" to Table B.  Lookup comes from Tabe A  

See above for tables       

 
Table A   Table B  
FruitColorAmt FruitColorLookup
AppleR5 AppleR5
OrangeO2 OrangeO2
PeachO7 PeachO7
PairR8 PairR8
    BerryF 
    AppleR5
    OrangeO2
    PairR8
  • Anonymous - Try LOOKUPVALUE or MAXX(FILTER(...),...) like:

    Lookup Column = 
      LOOKUPVALUE('TableA'[Amt],'TableA'[Fruit],[Fruit],'TableA'[Color],[Color])
    
    or
    
    Lookup Column = 
      MAXX(FILTER('TableA','TableA'[Fruit]=[Fruit] && 'TableA'[Color]=[Color]),'TableA'[Amt])
    
    

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous - Try LOOKUPVALUE or MAXX(FILTER(...),...) like:

    Lookup Column = 
      LOOKUPVALUE('TableA'[Amt],'TableA'[Fruit],[Fruit],'TableA'[Color],[Color])
    
    or
    
    Lookup Column = 
      MAXX(FILTER('TableA','TableA'[Fruit]=[Fruit] && 'TableA'[Color]=[Color]),'TableA'[Amt])