Forum Discussion
Anonymous
8 years agoNot applicable
Count 1 column with filter
Hi all,
So ive got the folowing challenge as a newbie:
| Asset | Damage |
| Car1 | YES |
| Car1 | YES |
| Car2 | NO |
| Car2 | NO |
| Car2 | Yes |
| Etc. | Etc. |
this is a simplified version of the data im working on. I only want to count the (distinct) items that only have the value "Yes" in the column "damage". So in case of the example the outcome is "1" (car 1 has only YES as damage) . Im struggeling how to apply a measure with this outcome.
Hi Anonymous
This measure would do the job hopefully
DistinctCars = COUNTROWS ( FILTER ( SUMMARIZE ( Cars, Cars[Asset], "Count", COUNT ( Cars[Damage] ) - CALCULATE ( COUNT ( Cars[Damage] ), Cars[Damage] = "Yes" ) ), [Count] = 0 ) )
6 Replies
- Greg_DecklerCommunity Champion
Measure = CALCULATE(DISTINCTCOUNT(Cars[Asset]),Cars[Damage]="YES")
- AnonymousNot applicable
Hi Greg_Deckler,
Thank you but this also counts the YES value with car2. I only want to distinct count if there arent any "no" values with a car.
Is there a solution for that?
- Zubair_MuhammadCommunity Champion
Hi Anonymous
This measure would do the job hopefully
DistinctCars = COUNTROWS ( FILTER ( SUMMARIZE ( Cars, Cars[Asset], "Count", COUNT ( Cars[Damage] ) - CALCULATE ( COUNT ( Cars[Damage] ), Cars[Damage] = "Yes" ) ), [Count] = 0 ) )