Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Reine
Helper IV
Helper IV

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.

 

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.

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

 

Do not hesitate if you need further help,

 

LC

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.