Forum Discussion
Count rows ignoring value in other rows
Hi all,
I need to create a measure from a single table "Pols Outcome", that provides me with what I believe is a countif, but I can't quite figure it out by videos. I need a single measure that gives me the total rows in "AP", excluding the values that are 0 in AP, whilst also not counting rows in "Canx/Void" with "Void" as a value.
In Excel this is a simple countifs formula =COUNTIFS('Pols Outcome'!F:F,"<>Void",'Pols Outcome'!M:M,">0").
If anyone could help me here it'd be greatly appreciated!
Kind reagrds,
Jordan
Hi,
Try this measure
=CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void"&&'Pols Outcome'[AP]>0)
Hope this helps.
6 Replies
- amitchandakSuper User
Anonymous , try like. add remove filter as per need. If you want to use OR use ||
countx(filter(table,table[Canx/Void]<>"void" && table[AP] <> 0),table[AP]) OR calculate(countrows(filter(table,table[Canx/Void]<>"void" && table[AP] <> 0))) - Ashish_MathurSuper User
Hi,
Try this measure
=CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void"&&'Pols Outcome'[AP]>0)
Hope this helps.
- AnonymousNot applicable
No luck unfortunately!
- Ashish_MathurSuper User
Hi,
Replace the && with a ,
- AnonymousNot applicableAshish_Mathur The below worked perfectly! Thank you for the response over the weekend and quick reply this morning!AP Cases = CALCULATE(COUNTROWS('Pols Outcome'),'Pols Outcome'[Canx/Void]<>"Void",'Pols Outcome'[AP]>0)Kind regards,Jordan
- Ashish_MathurSuper User
You are welcome.