Forum Discussion

RicardoLeivaG's avatar
6 years ago
Solved

Join and add data from tables with multiple data

HI, Groups,

 

I need your help.

 

I have a table with the following data:

 

Fill Rate
Sales OrdesQty Invoice
OV18
OV29
OV39

 

and another table with the following data

 

Detail Invoide
Sales OrdesQty OrderQty Ship
OV184
OV184
OV293
OV293
OV293
OV396
OV393

 

I need to add 1 column to the fill rate table that keeps me the value of the ordered qty of the OV detail table

 

Result:

Fill Rate 
Sales OrdesQty InvoiceQTY Order
OV188
OV299
OV399

 

 

Thanks

 

 

  • v-lid-msft's avatar
    v-lid-msft
    6 years ago

    Hi RicardoLeivaG ,

     

    If the two tables have relation with Sales Orders Column, we can create a calculated column to meet your requirement:

     

    QTY Order = CALCULATE(MAX('Detail Invoide'[Qty Order]),RELATEDTABLE('Detail Invoide'))

     

     

    If it does not meet you requirements, could you please make a more complex table or explain the logic of how to get the QTY Order column?


    Best regards,

     

3 Replies

  • RicardoLeivaG I'm sure you have already added a relationship of these to tables, add a measure 

     

    Qty Ordered = MAX ( SalesDetail[Qty Ordered] )

     

    In table visual, use sales order and qty invoice from sales table, and this Qty Ordered measure 

    • RicardoLeivaG's avatar
      RicardoLeivaG
      Helper I

      Dear:

       

      I tried his soucion but he doesn't show me the data, it just brings me the highest value in the table. 😞
      • v-lid-msft's avatar
        v-lid-msft
        Community Support

        Hi RicardoLeivaG ,

         

        If the two tables have relation with Sales Orders Column, we can create a calculated column to meet your requirement:

         

        QTY Order = CALCULATE(MAX('Detail Invoide'[Qty Order]),RELATEDTABLE('Detail Invoide'))

         

         

        If it does not meet you requirements, could you please make a more complex table or explain the logic of how to get the QTY Order column?


        Best regards,