Forum Discussion
Anonymous
6 years agoNot applicable
DISTINCTCOUNT with condition
I have data as shown belew id stage status 1 a complete 1 b complete 1 b not complete 2 a complete 2 b not complete I want to count number of id based on not...
- 6 years ago
I think this will work but please test properly with your data:
MeasureX = VAR _tabNot = SUMMARIZECOLUMNS(data[id], data[stage], FILTER(data,data[status] = "not complete")) VAR _tabComp = SUMMARIZECOLUMNS(data[id], data[stage], FILTER(data,data[status] = "complete")) RETURN COUNTROWS(_tabNot) - COUNTROWS(NATURALINNERJOIN(_tabComp, _tabNot))Each of the variables holds a table with the id and stage of the different statuses.
Count the 'not completed' rows. Subtract from this the count (of matching id and stage) rows that have a 'complete' and 'not complete' status.
jefe5
2 years agoNew Member
hello, I cant use your solution,, here is my table, mame Tableau2
I want to count number CDPs distinct whith contition=Retard, result=2
TI test
(SUMMARIZECOLUMNS(Tableau2[Nom CDPs],FILTER(Tableau2[Etat])="Retard")))
| Nom CDPs | Etat |
| Creation nouveaux bureaux , broyeur, zone decheterie | Soldé |
| Creation nouveaux bureaux , broyeur, zone decheterie | Soldé |
| Creation nouveaux bureaux , broyeur, zone decheterie | Retard |
| Creation nouveaux bureaux , broyeur, zone decheterie | Retard |
| Creation nouveaux bureaux , broyeur, zone decheterie | Retard |
| Creation nouveaux bureaux , broyeur, zone decheterie | Retard |
| nouvelles références | Retard |
| nouvelles références | En cours |
| nouvelles références | En cours |
| nouvelles références | En cours |
| t imprimante | Soldé |