cancel
Showing results for
Did you mean:
Helper III

## How to calculate with multiple filters

Hi all - I'm trying to return a count of items based on a few filters and can't quite figure it out.  A sample of my table is below.  "Total Charges" and "Paid Per Unit" are calculated columns.   I want to count how many line items have a "Paid Per Unit" value of under \$10 but more than \$0 and does not have anything in the "Description" column.  For this sample data it should return 1 - just the line with a Paid Per Unit of \$5.33.

My Dax isn't returning an error, but it isn't working.  It returns "2" - the lines with 8.65 and 9.79

Under \$10  =
CALCULATE (
COUNT ( ChargesT[Paid Per Unit] ),
FILTER (
ChargesT,
ChargesT[Paid Per Unit] < 10.00
),
( ChargesT[Paid Per Unit] <> 0.00 ),
(
NOT (
ISBLANK ( ChargesT[Description] )
)
)
)

I appreciate any help.  I'm coming to PBI from Excel and learning as I'm reporting so still struggling with understanding the differences in how it works.
1 ACCEPTED SOLUTION
Helper III

Thank you both @amitchandak  @lc_finance

Neither of those worked, but your responses helped me think about it a little differently and, with some googling, I did figure it out!  Instead of using NOT ISBLANK to filter out rows where there was something in the Description column,  I used  = BLANK() to count just the rows where that column is blank.  So, along with my other criteria, my measure now returns the correct number.

4 REPLIES 4
Solution Sage

Hi @Reine ,

what about the following formula:

```CALCULATE (
COUNT ( ChargesT[Paid Per Unit] )
, ChargesT[Paid Per Unit] < 10.00
, ChargesT[Paid Per Unit] <> 0.00
, NOT ( ISBLANK ( ChargesT[Description] ))

)```

Does it work?

LC

Interested in Power BI templates? Check out my blog at www.finance-bi.com

Super User IV

Please try using the filter

```CALCULATE (
COUNT ( ChargesT[Paid Per Unit] )
filter(ChargesT, ChargesT[Paid Per Unit] < 10.00
, ChargesT[Paid Per Unit] <> 0.00
, NOT ( ISBLANK ( ChargesT[Description] ))
)
)```

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helper III

Thank you both @amitchandak  @lc_finance

Neither of those worked, but your responses helped me think about it a little differently and, with some googling, I did figure it out!  Instead of using NOT ISBLANK to filter out rows where there was something in the Description column,  I used  = BLANK() to count just the rows where that column is blank.  So, along with my other criteria, my measure now returns the correct number.

Solution Sage

Nice to hear that your measure is now working for you!

Do not hesitate if you need further help,

LC

Announcements

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.