Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
crisxp
New Member

Sum by Product with a filter

Hi All!

 

I am struggling to group by product with a filter on it.

 

I would like to create the column "Sum_Apple", having the sum of the Apple price for each customer.

 

CustomerProduct TypePriceSum_Apple
AApple100300
AApple200300
BApple200200
BBanana100200
CBanana2000
CBanana2000

 

 

I have been using CALCULATE(SUM(Table[Price],ALLEXCEPT(Table[Customer])), which calculates fine the total price for all products, but in the moment I add the filter (Product = "Apple"), then it only shows the price for each product, not at customer level.

 

Any suggestion?

Thank you in advance!

2 ACCEPTED SOLUTIONS
Samarth_18
Community Champion
Community Champion

Hi @crisxp ,

 

Please try this:-

Sum_Apple =
CALCULATE (
    SUM ( 'Table'[Price] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Customer] ),
        'Table'[Product Type] = "Apple"
    )
) + 0

 

Output:-

Samarth_18_0-1644844468764.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

bcdobbs
Community Champion
Community Champion

Try the following it works for me with the data you sent:

Sum_Apple = 
    CALCULATE (
        SUM ( 'Table'[Price] ),
        ALLEXCEPT('Table', 'Table'[Customer] ),
        'Table'[Product Type] = "Apple"
    )

 

bcdobbs_0-1644845029672.png

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

View solution in original post

3 REPLIES 3
bcdobbs
Community Champion
Community Champion

Try the following it works for me with the data you sent:

Sum_Apple = 
    CALCULATE (
        SUM ( 'Table'[Price] ),
        ALLEXCEPT('Table', 'Table'[Customer] ),
        'Table'[Product Type] = "Apple"
    )

 

bcdobbs_0-1644845029672.png

 



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
crisxp
New Member

Thank you @Samarth_18 , I knew I was getting stucked in something that should be pretty easy. Thanks for your quick solution!!

Samarth_18
Community Champion
Community Champion

Hi @crisxp ,

 

Please try this:-

Sum_Apple =
CALCULATE (
    SUM ( 'Table'[Price] ),
    FILTER (
        ALLEXCEPT ( 'Table', 'Table'[Customer] ),
        'Table'[Product Type] = "Apple"
    )
) + 0

 

Output:-

Samarth_18_0-1644844468764.png

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors