Forum Discussion
qwertzuiop
Advocate III
3 years agoConditional count
Hello dear Power-BI-Community Following problem to solve: Let's assuem this table: Person Check A 1 A 0 A 0 B 0 B 0 C 1 C 1 D 0 D 0 D 0 Peo...
- 3 years ago
As Syk , suggested, this is easiest done in two steps. I would do it this way.
Create a new Calculated Column:
TotalChecks = CALCULATE( SUM(Checks[Check] ), ALLEXCEPT( Checks, Checks[Person] ))PersonCheckTotalChecks
A 1 1 A 0 1 A 0 1 B 0 0 B 0 0 C 1 2 C 1 2 D 0 0 D 0 0 D 0 0 Then create a new Measure:
0_Checks = CALCULATE( DISTINCTCOUNT( Checks[Person] ), FILTER( Checks, Checks[TotalChecks] = 0 ))Trust this works for you.
Regards,
rsbin
Community Champion
3 years agoAs Syk , suggested, this is easiest done in two steps. I would do it this way.
Create a new Calculated Column:
TotalChecks = CALCULATE( SUM(Checks[Check] ),
ALLEXCEPT( Checks, Checks[Person] ))
PersonCheckTotalChecks
| A | 1 | 1 |
| A | 0 | 1 |
| A | 0 | 1 |
| B | 0 | 0 |
| B | 0 | 0 |
| C | 1 | 2 |
| C | 1 | 2 |
| D | 0 | 0 |
| D | 0 | 0 |
| D | 0 | 0 |
Then create a new Measure:
0_Checks = CALCULATE( DISTINCTCOUNT( Checks[Person] ),
FILTER( Checks, Checks[TotalChecks] = 0 ))
Trust this works for you.
Regards,