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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Eesa
Frequent Visitor

CALCULATE with multiple filters

Hi all, 

 

I want to create a simple DAX measure that calculates the sum of sales for the column product, selecting only "iphone", "Samsung" and "Hawaii". 

 

I tried with below measure but it does not work. 

 

Smart Phones Sales = CALCULATE(SUM(Sales[Price]), Sales[product] = "iPhone", Sales[product] = "Samsung", Sales[product] = "Hawaii")

 

Thank you for your help 

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

@Eesa ,Try this

Smart Phones Sales =
CALCULATE (
    SUM ( Sales[Price] ),
    FILTER (
        Sales,
        Sales[product] in { "iPhone","Samsung","Hawaii"}
))

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

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @Eesa ,

 

You can try below code:-

Smart Phones Sales =
CALCULATE (
    SUM ( Sales[Price] ),
    FILTER (
        Sales,
        Sales[product] = "iPhone"
            && Sales[product] = "Samsung"
            && Sales[product] = "Hawaii"
    )
)

iphone,samsung,hawaii is case sensitive so it should be written in same way as its available in dataset.

 

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

Hi Samarth, 

 

Thank you for your reply. I tried but it does not work. 
when I tried with single filter like: 

 

Smart Phones Sales =
CALCULATE (
    SUM ( Sales[Price] ),
    FILTER (
        Sales,
        Sales[product] = "iPhone"
))

It works well, but when I add another filter it gives me (Blank) with card visual. I tried to copy and paste the the word to avoid case errors but still does not work. 

Samarth_18
Community Champion
Community Champion

@Eesa ,Try this

Smart Phones Sales =
CALCULATE (
    SUM ( Sales[Price] ),
    FILTER (
        Sales,
        Sales[product] in { "iPhone","Samsung","Hawaii"}
))

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

Thank you @Samarth_18
It works!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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