Forum Discussion
grggmrtn
6 years agoPost Patron
Counting filtered data (AND filter)
I've created a matrix visual based on this sample data: PersonID WeekNr Service
1 12 A
1 12 B
1 13 A
1 13 B
1 14 A
1 15 A
2 12 A
2 13 B
2 15 A
2 15 B
2 16 A
2 ...
- 6 years ago
Hi grggmrtn ,
this has to do with contex of the measure try the following:
Measure 2 = var temp_table = SUMMARIZE(Data; Data[PersonID];Data[WeekNr]; "@Value";[Measure]) return CALCULATE ( DISTINCTCOUNT ( Data[PersonID] ); FILTER(temp_table; [@Value] > 0) )Replace the Data[WeekNr] by the date column, should work as expected.
mahoneypat
6 years agoMicrosoft Employee
How about this expression?
Person Count = CALCULATE(DISTINCTCOUNT(Date[PersonID]), ALLSELECTED(Data))
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
- grggmrtn6 years agoPost Patron
Sorry, that's giving me the same result as just a simple DISTINCTCOUNT(Data[PersonID])