# PowerPivot measure - Cacluate() using filter and "OR" syntax



## zacc206 (Sep 13, 2013)

I am using the below measure in PowerPivot (Excel 2013):


```
=CALCULATE(COUNTA(ShoppingCart[Fruit]), ShoppingCart[Fruit]="Apple")
```

This will give me the the number of records in the "Fruit" column that are equal to "Apple". I'd like to include "Oranges" in my filter, so that I can have a count of records in the "Fruit" column that are either "Apple" or "Orange".

All the documentation I find on using filters in the CALCULATE() function describe how to do "Apple" and "Orange". 

Does anyone know how to go about using "OR" syntax in the CALCULATE() function filter?


----------



## StrafeXL (Sep 13, 2013)

CALCULATE(COUNTA(ShoppingCart[Fruit]), ShoppingCart[Fruit]="Apple" || ShoppingCart[Fruit]="Orange")

Although my first inclination would be to use COUNTROWS instead of COUNTA. BTW, if you did want to do an AND, you can also use && and it would perform better than separating filters with a comma.


----------

