Forum Discussion
Distinct count measure
- Anonymous7 years ago
Add a column that tracks if your Column1 has one A61/2 row
Has6162=
VAR thisOpCode=Table[Column1]
RETURN
IF(SUMX(FILTER(Table;Table[Column1]=thisOpCode);IF(Table[Column2] IN {"A61";"A62"};1;0))>=1;1;0)this column will (should :-) ) contain 1 if that opcode has at least one A61, A62
Now your measure will count only the ones where that value is 0
Measure=DISTINCTCOUNT(FILTER(Table;Table[Has6162] =0);Table[Column1])
Check syntax and test, but should work
Add a column that tracks if your Column1 has one A61/2 row
Has6162=
VAR thisOpCode=Table[Column1]
RETURN
IF(SUMX(FILTER(Table;Table[Column1]=thisOpCode);IF(Table[Column2] IN {"A61";"A62"};1;0))>=1;1;0)
this column will (should :-) ) contain 1 if that opcode has at least one A61, A62
Now your measure will count only the ones where that value is 0
Measure=DISTINCTCOUNT(FILTER(Table;Table[Has6162] =0);Table[Column1])
Check syntax and test, but should work