Have this measure in a Matrix with two columns in the Row field (Serviceline and Department). When I expand the department, the calculation is correct, but when collapsed, the Serviceline % is not, some are greater than 100%. Any quick and easy solutions? Thanks in advance.
vacctest =
var FullyVaccPos = CALCULATE(sum(Pop[FULLYVACC]),Pop[Ip_hosp]=1,LASTDATE(Pop[CALENDAR_DT]),Pop[OCCUPANCY]=1)
var TotalPop = calculate(sum(Pop[OCCUPANCY]),Pop[TEST_STATUS]="Positive",LASTDATE(Pop[CALENDAR_DT]))
return DIVIDE(fullvaccPos,TotalPop)
vacctest =
var FullyVaccPos = CALCULATE(sum(Pop[FULLYVACC]),Pop[Ip_hosp]=1,LASTDATE(Pop[CALENDAR_DT]),Pop[OCCUPANCY]=1)
var TotalPop = calculate(sum(Pop[OCCUPANCY]),Pop[TEST_STATUS]="Positive",LASTDATE(Pop[CALENDAR_DT]))
return DIVIDE(fullvaccPos,TotalPop)