When I select one slice of the pie chart, everything filters and the average is calculated, but if I select more than one slice of the pie chart, I receive the 'error' section of my if statement but I have no idea why. The slices are using the same variable as the KPI if statement but if I select more than one slice, it fails. Any ideas?
Hard to say without knowing what's behind those variables. Best guess is at least one of them contains an expression that won't work correctly if you select multiple values in whatever dimension the pie chart is using. Another alternative is that your KPI expression doesn't return a single value in this scenario, and since it's not wrapped in an aggregation function, that would cause it to null out.