Forum Discussion

The_Clam's avatar
The_Clam
Icon for Helper I rankHelper I
3 years ago
Solved

Seeking assistance with LOOKUPVALUE. Example Power BI file linked.

Hi. I am trying to perform a LOOKUPVALUE in Power BI with a few stipulations. I need the LOOKUPVALUE for ID in Table B to show up in Table A IF UNIT = UNIT and DATE = DATE and Code <> F. In the Power BI example data provided below in the link, Table A should show 17 IDs. There should be blanks otherwise. Please help. Thank you!

 

https://drive.google.com/file/d/1l6hHAEzV-Ch4Ulc0Pxyp5KNN1VujbriP/view?usp=sharing

 

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  , 

    According to your description, you want to get the id in table b to table a .

    Here are the steps you can refer to :

    (1)You can create a measure like this:

     

    ID Test = 
    var _unit = MAX('Table A'[Unit]) 
    var _date = MAX('Table A'[Date])
    var _t =FILTER( 'Table B' , 'Table B'[Unit]= _unit && 'Table B'[Date]= _date && 'Table B'[Code] <> "F" ) 
    RETURN 
    MAXX(_t,[ID])

     

    (2)Then we can meet your need:

    Best Regards,

    Neeko Tang

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

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  , 

    According to your description, you want to get the id in table b to table a .

    Here are the steps you can refer to :

    (1)You can create a measure like this:

     

    ID Test = 
    var _unit = MAX('Table A'[Unit]) 
    var _date = MAX('Table A'[Date])
    var _t =FILTER( 'Table B' , 'Table B'[Unit]= _unit && 'Table B'[Date]= _date && 'Table B'[Code] <> "F" ) 
    RETURN 
    MAXX(_t,[ID])

     

    (2)Then we can meet your need:

    Best Regards,

    Neeko Tang

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