Forum Discussion

Tiago_Varela's avatar
Tiago_Varela
Helper I
8 years ago
Solved

SUM ALL VALUES EXCEPT

Hi all,

I have a problem, i'm triyng to sum all the values in a table, except the ones in another table.

Example:

 

Table 1

A = 10

B = 10

C = 30

D = 30

E = 50

f = 60

 

Table 2

B

D

 

So, i want the sum of A, C, E, F

 

Is there any dax formula for this?

Thanks

  • Anonymous's avatar
    Anonymous
    8 years ago

    Hi Tiago_Varela

     

    Try this

    Sum_Value = CALCULATE(SUM('Table_A'[Value]),
                           FILTER('Table_A','Table_A'[ID]<>RELATED(Table_B[ID])))

     

     

     

    Thanks
    Raj

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Tiago_Varela

     

    Try this

    Sum_Value = CALCULATE(SUM('Table_A'[Value]),
                           FILTER('Table_A','Table_A'[ID]<>RELATED(Table_B[ID])))

     

     

     

    Thanks
    Raj

    • ngct1112's avatar
      ngct1112
      Post Patron

      Anonymous Do you have any idea why there is apostrophe'' for 'Table A' but nothing for Table B

      which I could not refer to my Table B in your provided formula

      • ngct1112's avatar
        ngct1112
        Post Patron

        Anonymous Here is the similar model I am working on. I find that I could not put Table B in the formula