Forum Discussion
Anonymous
6 years agoNot applicable
COUNTROWS FILTER - Multiple Values
Hello, I have a column that has a number of 1's and 0's and I want to count how many 1's there are and 0's there are as they are base don a different column. I have tried to use the below m...
- 6 years ago
Hi Anonymous ,
You need to split your measure into 2,1 is for calculating the number of 1's and the other is for the number of 0's:
If the data of the column is a text type,using:
Measure for 1 = CALCULATE( COUNTROWS(Table_query), FILTER(Table_query, Table_query[Recharge Decision] = "1")Measure for 0= CALCULATE( COUNTROWS(Table_query), FILTER(Table_query, Table_query[Recharge Decision] ="0"),If the data of the column is a whole number type,using:
Measure for 1 = CALCULATE( COUNTROWS(Table_query), FILTER(Table_query, Table_query[Recharge Decision] = 1)Measure for 1 = CALCULATE( COUNTROWS(Table_query), FILTER(Table_query, Table_query[Recharge Decision] = 0)Best Regards,
KellyDid I answer your question? Mark my post as a solution!
amitchandak
6 years agoSuper User
If there other values then 1 and 0 then
Measure = CALCULATE(
COUNTROWS(Table_query),
FILTER(Table_query, Table_query[Recharge Decision] = "1" || Table_query[Recharge Decision] ="0"))
Other wise create 2 measures
Measure1 = CALCULATE(
COUNTROWS(Table_query),
FILTER(Table_query, Table_query[Recharge Decision] = "1" ))
Measure2 = CALCULATE(
COUNTROWS(Table_query),
FILTER(Table_query, Table_query[Recharge Decision] ="0"))