# DAX Formula to count any entries in a column greater than 20%



## ekedubois (Jun 13, 2014)

Hello,

New to Powerpivot. How do I use DAX formula to count any entries in a column greater than 20%?

I need a quantitative value returned.
I tried different variations of the following:
Disc >20%:=CALCULATE(COUNTROWS('ALL'), ('ALL'[DISCOUNT %]>="20%))

Thank you in advance


----------



## HillDragon (Jun 13, 2014)

Hi ekedubois,
   So two things about your question.
1. it looks like your table is named "all" so I'm going off of that assumption.
2. are the discounts a number or a text string?

If you are working with text you will need to convert the column to a number format before you can do a greater than comparative. I would recommend using SUBSTITUTE() to replace the "%"s from the fields in the column with blanks, probably with a calculated column.

```
=SUBSTITUTE( ALL[DISCOUNT %], "%", "")
```
Then you can run your calculate and compare any number that is higher than 20

```
CALCULATE( COUNTROWS( [ALL] ), ALL[DISCOUNT %] >= 20 )
```

I noticed that you had the Calculate filter (all[discount %] >= 20%) in parenthesis so that may also be the reason it was not working for you.
Let me know if my assumptions were off and we can help you get it going.


----------



## ekedubois (Jun 13, 2014)

Thank you very HillDragon!!!
I wish I could have you for the day here! It's working.


----------

