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

ekedubois

New Member
Joined
Jun 13, 2014
Messages
5
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
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
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.
Code:
=SUBSTITUTE( ALL[DISCOUNT %], "%", "")
Then you can run your calculate and compare any number that is higher than 20
Code:
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.
 
Upvote 0

Forum statistics

Threads
1,216,997
Messages
6,133,941
Members
449,849
Latest member
nnnyyy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top