Forum Discussion
tcmem
8 years agoRegular Visitor
How to include Zeros in column value count
I'm trying to calculate a count of items in a column that are less than or equal to 12. For some reason, it's excluding the Zeros. How do I include the Zeros in my count? I'm also excluding blanks ba...
- 8 years ago
Hi, you can use:
Measure = COUNTROWS ( FILTER ( Table1, ISBLANK ( Table1[Field2] ) = FALSE () && Table1[Field2] <= 12 ) )Measure = CALCULATE ( COUNT ( Table1[Field2] ), FILTER ( Table1; ISBLANK ( Table1[Field2] ) = FALSE () && Table1[Field2] <= 12 ) )Regards
Victor
Lima - Peru
tcmem
8 years agoRegular Visitor
Here's an example of my data:
| Field1 | Field2 |
| Acct1 | 13 |
| Acct2 | |
| Acct3 | 1 |
| Acct4 | 5 |
| Acct5 | |
| Acct6 | 3 |
| Acct7 | 0 |
| Acct8 | 12 |
Based on my criteria of counting Field1 where Field2 is <= 12 and NOT BLANK, the results should be a count of 5.
Ashish_Mathur
Super User
8 years agoHi tcmem,
This will also work
=CALCULATE(COUNTROWS(Data),Data[Field2]<=12)-COUNTBLANK(Data[Field2])
Hope this helps.
- tcmem8 years agoRegular Visitor
Hello Ashish,
Are you able to use two different Fields in this function? I need to remove blanks in Field1 & Field2.
Thanks for your help!
- Ashish_Mathur8 years ago
Super User
Hi,
Subtract another COUNTBLANK() with the other field