Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Sum except one cateogry

 I want sum a table but without one category, like a filter, but this expression do the opposite what i want. I think the answer is not hard but i can't find, the most close i don't understand. 

 

example without the data 3:

Category

Value

Data 1

10

Data 2

15

Data 3

9

Total 

25

I want this total ðŸ¤”

  • Anonymous 

    Try it like this.

    Filtered Value = 
    IF ( 
        ISINSCOPE ( YourTable[Category] ), CALCULATE ( SUM ( YourTable[Value] ) ),
        CALCULATE ( SUM ( YourTable[Value] ), NOT YourTable[Category] IN {"Data 3"} )
    )

     

1 Reply

  • Anonymous 

    Try it like this.

    Filtered Value = 
    IF ( 
        ISINSCOPE ( YourTable[Category] ), CALCULATE ( SUM ( YourTable[Value] ) ),
        CALCULATE ( SUM ( YourTable[Value] ), NOT YourTable[Category] IN {"Data 3"} )
    )