Forum Discussion
Measures affecting filter behavior
Hi Believer ,
This is due to the ALLEXCEPT function, which ignores the filter for calculation.
Try measure like below:
Cust DBs Tot = var current_source = MAX(Codes[Source])
var current_code = MAX(Codes[Code])
return CALCULATE(DISTINCTCOUNT('Codes'[Name]),FILTER(ALLSELECTED(Codes),Codes[Code]=current_code&&Codes[Source]=current_source))
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Believer4 years agoAdvocate IV
V-lianl-msft I think you misunderstand my question. My calculations are exactly what I expect. The behavior I do not expect is that the "F" records aren't dropped from the list of data like they should be, resulting in fewer rows displayed. Instead, the records stay on the screen with blank results. So it's not a calc issue, but a filter behavior issue... but only when the calculations I mentioned are in the view. If they're not there, the filter behaves as expected. I actually added two more columns to the view Min(Type) and Max(Type). Since there are only 2 types, this works well to show something else unusual... With non-filtered data, min/max(Type) are F and H on each row wherever apprpriate for the data. Of the offensive measure are not in the view, the filtering on F or H results in only F or H min/max values, as expected. But when the offending measure(s) are added back in... every row shows F and H no matter what. This demonstrates that Power BI thinks there are F and H in each row, and why the rows aren't removed by the filter. By why does Power BI think this? (Hopefully all that makes sense...)