Forum Discussion

ricardocamargos's avatar
ricardocamargos
Continued Contributor
8 years ago
Solved

Compare tables

Hi there,

 

I do need to compare the product and its parent product.

 

The structure is this:

 

CD_PRODUCT INT, DS_PRODUCT VARCHAR, VL_PRODUCT NUMERIC, CD_PRODUCT_PARENT INT.

 

I do need to show the product, its parent and the parent's information.

 

Does anyone know how to return a table after compare in dax ? I need to show it on a table/matrix.

 

Thank you,

 

Ricardo

  • v-qiuyu-msft's avatar
    v-qiuyu-msft
    8 years ago

    Hi ricardocamargos,

     

    In your scenario, you can create a calculated column like below: 

     

    Parentinfo = LOOKUPVALUE(Table2[DS_PRODUCT],'Table2'[CD_PRODUCT],'Table2'[CD_PRODUCT_PARENT])

     

     

    Best Regards,
    Qiuyun Yu 

4 Replies

  • Hi,

     

    I cannot understand your question.  Show a simple dataset and the expected result.

    • ricardocamargos's avatar
      ricardocamargos
      Continued Contributor

      Hi Ashish_Mathur,

       

      I have a hierarchical product table. It's like this:

       

      COLUMN_NAME -  COLUMN_TYPE

       

      CD_PRODUCT - INT,

      DS_PRODUCT - VARCHAR,

      VL_PRODUCT  -  NUMERIC,

      CD_PRODUCT_PARENT - INT

       

      I can separate the datasets (child product and parent products) but I need to show the parent's information when I click on child product.

       

      I'm attaching an example:

      CD_PRODUCTDS_PRODUCTVL_PRODUCTCD_PRODUCT_PARENT
      1PEN1.00 
      2PENCIL1.00 
      3PEN - 20171.001
      4PENCIL - 20171.002

       

       

      Thank you,

       

      Ricardo

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

         

        I just do not understand.  Someone else who does, will help.  Sorry.