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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors