Forum Discussion

IrenaG's avatar
IrenaG
Regular Visitor
6 years ago
Solved

merge queries

Hello, I have 3 tables: 

In table 1 I have the sum price of the product that name is 'ORANGE". The number of product is 201619038.

 namenumbersum
orange20161903895,608.13

In table 2 I have the sum price of the same product that name  'ORANGE" but it appears in two lines. The total result is the same 95,608.13.

namenumbersum
orange9639566591,575.50
orange9678444,032.63
total 95,608.13

In table 3 I have Conversion Table for number of product:

namethe number in table 1the number in table 2
orange20161903896395665
orange201619038967844
The question is: how can I do the merge of table 1 & 2 if I have to get to the result like this:
 name  from table 1numbersum  from table 2 numbersumdifference
orange20161903895,608.139639566591,575.504,032.63
orange201619038 9678444,032.63-4,032.63

Thank you in advance

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    The short answer is you can't get exactly what you described in your last entry.  You can get a table that is pretty close, but the Sum column will repeat.

     

    The best you could do is start with Table 3 and merge in the contents of 1 and 2.

     

    Alternatively you could bring all 3 tables into Power BI and create relationships from 3 -> 1 and 3 -> 2, then build the table inside your visuals instead, using Table 3 as the row headers.

    • IrenaG's avatar
      IrenaG
      Regular Visitor

      thank you, I will try to fix it