Forum Discussion

Raul's avatar
Raul
Post Patron
8 years ago
Solved

Sum column values based on another table

Hello, I have this situation:   TABLE2         Line Expense CodArea Date Office 1 10 Area1 01/01/2017 Office1 2 20 Area3 02/01/2017 Office1 3 15 Area2 03/02...
  • srinivt's avatar
    srinivt
    8 years ago

    It is because of relationships are not appropriately defined in your model. Looking at your model, it seems like you need to make the following changes: 

    - Change Relationship between Table1 and Calendar to be Many-to-One and Single-Directional. (Note the Many should be from Table1). 

    - Change Relationship between Table2 and Calendar to be Many-to-One and Single-Directional. Then ensure that the relationship is active. (Again note that Table2 should be many side.)

    - Create new relationship between Table2[Office] and Offices[Office] as Many-To-One and Single-Directional.

    - Change the measure TotalExpense = SUM(Table2[Expense]). It is possible that I misunderstand the requirement for this measure. But it is good to start simple and then define a more complex measure if needed.

     

    I tried these changes and seem to be getting the correct numbers, but you should verify if that is what you want.