Forum Discussion

3mi81's avatar
3mi81
Regular Visitor
1 year ago
Solved

Comparing values between different tables

Hello, I have a table "LIST" composed by three columns: ID, COD, VALUE. I have another table "CONTAINER" composed by two columns : COD , SUM_OF_VALUE I would like to save in the SUM_OF_VALUE column...
  • BA_Pete's avatar
    BA_Pete
    1 year ago

     

    Ok. If you're using Power BI Desktop you just need to apply both your tables to the model, relate LIST to CONTAINER on CONTAINER[COD] 1 = * LIST[COD] (assuming your CONTAINER table contains a UNIQUE list of customers), then drag CONTAINER[COD] and LIST[VALUE] columns into a visual. PBI will automatically aggregate the result giving you what it sounds like you're after.

     

    If this is to be done in Excel, then probably easiest to just do a merge in PQ instead of a relationship as described above in the model.

     

    Pete

  • ZhangKun's avatar
    1 year ago

    Use merge query in Power Query, or load the data into the model and use DAX to calculate (aggregate and then determine whether it is greater than 0).