Create a weight factor based on some variable

weight_factor = COUNT(dimension) / TOTAL(COUNT(dimension))

AVG(measure) * weight_factor