Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

SUM RELATED

Hello,

I have 2 tables with a many to many relationship. I need to sum the costs from table 1 but filter based on the other table.
The RELATED function doesnt work for me because of the many to many relation. How can I still realize to sum it?

Thanks in advance 

2 Replies

  • v-chenwuz-msft's avatar
    v-chenwuz-msft
    Community Support

    Hi Anonymous 

     

    if you want to create a column, please try some dax expression like the following :

    Column =
    CALCULATE(
        SUM( 'Table (1)'[cost] ),
        FILTER( 'Table (2)', the filter conditions )
    )
    

     

    if you want calculate values in visual, you can just put the field from table 2 in the Filters and sum() function will keep the filter.

     

    Best Regards

    Community Support Team _ chenwu zhu

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.