Forum Discussion
newgirl
4 years agoPost Patron
Distinct Count per Group
Hi! I have a raw data of transactions of our clients, in which some clients belong to the same group which is why there's a column representing their grouping. Ex. Group 1 is an individual client whi...
- 4 years ago
OK, I've created a column:
AllNoinGroupMinPoints = var _Group = Sales[Group]
var _rowsInGroup = COUNTROWS(FILTER(Sales, Sales[Group] = _Group))
var _rowsInGroupWithNo = COUNTROWS(FILTER(Sales, Sales[Group] = _Group && Sales[Minimum Points] = "No"))
RETURN
IF(_rowsInGroup = _rowsInGroupWithNo, 1, 0)and then a measure to use the column:F_MinPTest = CALCULATE( DISTINCTCOUNT(Sales[Group]), Sales[AllNoinGroupMinPoints] = 1)Please test at your side.
Greg_Deckler
4 years agoCommunity Champion
newgirl Seems like you should be able to use a measure along the lines of:
COUNTROWS(DISTINCT(FILTER(ALL('Table'),<filter conditions>)))
or potentially:
COUNTROWS(DISTINCT(SELECTCOLUMNS(FILTER(ALL('Table'),<filter conditions>),"column",[Column])))
I wasn't quite following the conditions.