Forum Discussion

ADP007's avatar
ADP007
Helper IV
7 years ago

DAX Lookup column on same table

Hello

I would like to add a column to a table that looks up a specific value from the same table based on the current row

This works but the values are hard coded and not the values from the current row

 

=LOOKUPVALUE

( 'Media Invest'[Magazine Page Number];

'Media Invest'[Magazine Name];"MAACW01";

'Media Invest'[Publication Date];20160301;

'Media Invest'[Magazine Insertion Placement];"4C" )

 

what I want to do is find a specific value in the same table for the magazine name and publication date

This doesn't work

=LOOKUPVALUE

( 'Media Invest'[Magazine Page Number];

'Media Invest'[Magazine Name]; 'Media Invest'[Magazine Name];

'Media Invest'[Publication Date; 'Media Invest'[Publication Date];

'Media Invest'[Magazine Insertion Placement];"4C" )

 

I could do this in the underlaying SQL view but it's slow Any help is welcome

Thanks David

2 Replies

  • v-danhe-msft's avatar
    v-danhe-msft
    Microsoft Employee

    Hi ADP007 ,

    Could you please offer your sample data and your desired result if possible that I could have a test for you?

     

    Regards,

    Daniel He

    • ADP007's avatar
      ADP007
      Helper IV

      Hi Daniel

       

      I'm trying to add a column which is the total pages of a magazine (FK_Support) for a specific date (FK_Calendar). This is the value of MA_PAGNUM where MA_ISRPLC = '4C'

      The lines in blue illustrate the result where the MA_PagNum is 148 where FK_Support is 'MAACW01' and FK_Calendar is 20190301 and MA_ISRPLC = '4C'. I want to add this 148 to all MAACW01 for 20190301

       

      Thanks in advance

      David