topic How to calculate with multiple filters in Desktop
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822318#M395050
<P>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.</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample data.png" style="width: 400px;"><img src="https://community.powerbi.com/t5/image/serverpage/image-id/201488i607ED38A797FD64E/image-size/medium?v=v2&px=400" role="button" title="sample data.png" alt="sample data.png" /></span></P><P> </P><P>My Dax isn't returning an error, but it isn't working. It returns "2" - the lines with 8.65 and 9.79 </P><P> </P><DIV><DIV><SPAN>Under $10 = </SPAN></DIV><DIV><SPAN>CALCULATE (</SPAN></DIV><DIV><SPAN>COUNT ( ChargesT[Paid Per Unit] ),</SPAN></DIV><DIV><SPAN>FILTER (</SPAN></DIV><DIV><SPAN>ChargesT,</SPAN></DIV><DIV><SPAN>ChargesT[Paid Per Unit] < 10.00</SPAN></DIV><DIV><SPAN>),</SPAN></DIV><DIV><SPAN>( ChargesT[Paid Per Unit] <> 0.00 ),</SPAN></DIV><DIV><SPAN>(</SPAN></DIV><DIV><SPAN>NOT (</SPAN></DIV><DIV><SPAN>ISBLANK ( ChargesT[Description] )</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV> </DIV><DIV><SPAN>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.</SPAN></DIV></DIV>Sat, 19 Oct 2019 02:06:52 GMTReine2019-10-19T02:06:52ZHow to calculate with multiple filters
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822318#M395050
<P>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.</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample data.png" style="width: 400px;"><img src="https://community.powerbi.com/t5/image/serverpage/image-id/201488i607ED38A797FD64E/image-size/medium?v=v2&px=400" role="button" title="sample data.png" alt="sample data.png" /></span></P><P> </P><P>My Dax isn't returning an error, but it isn't working. It returns "2" - the lines with 8.65 and 9.79 </P><P> </P><DIV><DIV><SPAN>Under $10 = </SPAN></DIV><DIV><SPAN>CALCULATE (</SPAN></DIV><DIV><SPAN>COUNT ( ChargesT[Paid Per Unit] ),</SPAN></DIV><DIV><SPAN>FILTER (</SPAN></DIV><DIV><SPAN>ChargesT,</SPAN></DIV><DIV><SPAN>ChargesT[Paid Per Unit] < 10.00</SPAN></DIV><DIV><SPAN>),</SPAN></DIV><DIV><SPAN>( ChargesT[Paid Per Unit] <> 0.00 ),</SPAN></DIV><DIV><SPAN>(</SPAN></DIV><DIV><SPAN>NOT (</SPAN></DIV><DIV><SPAN>ISBLANK ( ChargesT[Description] )</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV><SPAN>)</SPAN></DIV><DIV> </DIV><DIV><SPAN>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.</SPAN></DIV></DIV>Sat, 19 Oct 2019 02:06:52 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822318#M395050Reine2019-10-19T02:06:52ZRe: How to calculate with multiple filters
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822493#M395155
<P>Hi <LI-USER uid="104011"></LI-USER> ,</P><P> </P><P> </P><P>what about the following formula:</P><P> </P><PRE>CALCULATE (
COUNT ( ChargesT[Paid Per Unit] )
, ChargesT[Paid Per Unit] < 10.00
, ChargesT[Paid Per Unit] <> 0.00
, NOT ( ISBLANK ( ChargesT[Description] ))
)</PRE><P>Does it work?</P><P> </P><P>LC</P><P>Interested in Power BI templates? Check out my blog at <A href="http://www.finance-bi.com" target="_blank">www.finance-bi.com</A></P><P> </P><P> </P>Sat, 19 Oct 2019 20:25:34 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822493#M395155lc_finance2019-10-19T20:25:34ZRe: How to calculate with multiple filters
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822571#M395202
<P>Please try using the filter</P><P> </P><PRE>CALCULATE (
COUNT ( ChargesT[Paid Per Unit] )
filter(ChargesT, ChargesT[Paid Per Unit] < 10.00
, ChargesT[Paid Per Unit] <> 0.00
, NOT ( ISBLANK ( ChargesT[Description] ))
)
)</PRE><P><STRONG>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 @ </STRONG><BR />Thanks.</P><P> </P>Sun, 20 Oct 2019 07:01:15 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822571#M395202amitchandak2019-10-20T07:01:15ZRe: How to calculate with multiple filters
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822630#M395232
<P>Thank you both <LI-USER uid="148838"></LI-USER> <LI-USER uid="176844"></LI-USER> </P><P> </P><P>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 <SPAN>= BLANK() to count just the rows where that column is blank. So, along with my other criteria, my measure now returns the correct number.</SPAN></P>Sun, 20 Oct 2019 18:28:59 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822630#M395232Reine2019-10-20T18:28:59ZRe: How to calculate with multiple filters
https://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822657#M395246
<P>Nice to hear that your measure is now working for you! </P><P> </P><P>Do not hesitate if you need further help,</P><P> </P><P>LC</P><P> </P>Sun, 20 Oct 2019 20:40:09 GMThttps://community.powerbi.com/t5/Desktop/How-to-calculate-with-multiple-filters/m-p/822657#M395246lc_finance2019-10-20T20:40:09Z