Forum Discussion

dw700d's avatar
dw700d
Post Patron
5 years ago
Solved

Excluding items while Summing

I am trying to create a measure that calculates the Sum of all spend for Type A while excluding Accounts 9,10,11. Can anyone help me with this?

 

Type  SpendAccount
A20,000,000     1              
A20,000,0002
A20,000,0003
A20,000,0004
A20,000,0005
A50,000,0006
A10,000,0007
A10,000,0008
A50,000,0009
A50,000,00010
A50,000,00011
B10,000,0003
B10,000,0003
  • You can use a measure expression like this

     

    NewMeasure = CALCULATE(SUM(Table[Spend]), NOT(Table[Account] IN {9,10,11}))

     

    If Account is a text column, put each value in double quotes.

    Regards,

    Pat

2 Replies

  • mahoneypat's avatar
    mahoneypat
    Microsoft Employee

    You can use a measure expression like this

     

    NewMeasure = CALCULATE(SUM(Table[Spend]), NOT(Table[Account] IN {9,10,11}))

     

    If Account is a text column, put each value in double quotes.

    Regards,

    Pat