cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Reine
Helper III
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.

 

sample data.png

 

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

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.

View solution in original post

4 REPLIES 4
lc_finance
Solution Sage
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

 

 

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!

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.

View solution in original post

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

 

Do not hesitate if you need further help,

 

LC

 

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

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.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors