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.
grggmrtn
6 years agoPost Patron
Hi MFelix
There is only one table.
The matrix looks like this ("CPR" = PersionID, "Indsats Navn" = Service, columns are year, quarter, week number - "Borger Navn" is the Person's name and "Leverandør" is the provider, but neither of those should have an influence on the results)
There are 5 slicers on the page, but I have disabled them all. There are no filters.
Which makes the (Empty) result in the card just all the more strange...
MFelix
6 years agoSuper User
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.