Forum Discussion
Visualization data changes when using count filtering
- Anonymous1 year ago
Hi, Sharkybu
Thanks for reaching out to the Microsoft fabric community forum.Regarding the issue you raised, my solution is as follows:
Based on my tests, the issue you are encountering is mainly due to the count aggregation method's calculation process not being directly affected by filters. In other words, when you use the aggregation method on a field, the filters will only determine whether the row values are displayed, but they will not affect the calculation result itself.
If you want to get the desired result directly, I recommend using the following measure:
MEASURE = VAR cc1 = SELECTEDVALUE ( 'Table 2'[Facility] ) RETURN CALCULATE ( DISTINCTCOUNT ( 'Table'[ID] ), FILTER ( 'Table', 'Table'[internal hire] = "Yes" && CONTAINSSTRING ( 'Table'[Project facility], cc1 ) ) )The final result is as follows:
Please note that my visual object does not have any filters set.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Sharkybu
Thanks for reaching out to the Microsoft fabric community forum.
Regarding the issue you raised, my solution is as follows:
Based on my tests, the issue you are encountering is mainly due to the count aggregation method's calculation process not being directly affected by filters. In other words, when you use the aggregation method on a field, the filters will only determine whether the row values are displayed, but they will not affect the calculation result itself.
If you want to get the desired result directly, I recommend using the following measure:
MEASURE =
VAR cc1 =
SELECTEDVALUE ( 'Table 2'[Facility] )
RETURN
CALCULATE (
DISTINCTCOUNT ( 'Table'[ID] ),
FILTER (
'Table',
'Table'[internal hire] = "Yes"
&& CONTAINSSTRING ( 'Table'[Project facility], cc1 )
)
)
The final result is as follows:
Please note that my visual object does not have any filters set.
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Sharkybu1 year agoHelper II
Thank you, thank you, thank you!!!
- Anonymous1 year agoNot applicable
Hi, Sharkybu
I am glad that my answer could help you, and I appreciate you accepting my answer as the solution. This recognition of my efforts also helps others in the community with similar issues find solutions more quickly.If you encounter any problems in the future, feel free to share them again.
Have a great day!
Best Regards,
Leroy Lu