Forum Discussion
Adding a visual, (count distinct) filter to all visuals
- 4 years ago
Measures can't be added as page filters, so you have two options.
Option 1
Add a visual filter to each visual. This will ensure that any user-specified filters (e.g., slicer) are included in the filter context. You can rewrite the measure to correctly calculate totals:
Count of PatchName = SUMX ( VALUES ( Table1[ComputerName] ), CALCULATE ( DISTINCTCOUNT ( Table1[PatchName] ) ) )Option 2
Create a calculated column and add it as a page filter. This approach will not include any user-specified filters in the filter context, however.
Count of PatchName Col = CALCULATE ( DISTINCTCOUNT ( Table1[PatchName] ), ALLEXCEPT ( Table1, Table1[ComputerName] ) )
Measures can't be added as page filters, so you have two options.
Option 1
Add a visual filter to each visual. This will ensure that any user-specified filters (e.g., slicer) are included in the filter context. You can rewrite the measure to correctly calculate totals:
Count of PatchName =
SUMX ( VALUES ( Table1[ComputerName] ), CALCULATE ( DISTINCTCOUNT ( Table1[PatchName] ) ) )
Option 2
Create a calculated column and add it as a page filter. This approach will not include any user-specified filters in the filter context, however.
Count of PatchName Col =
CALCULATE (
DISTINCTCOUNT ( Table1[PatchName] ),
ALLEXCEPT ( Table1, Table1[ComputerName] )
)
Option 2 works like a charm. 😉
Thank you very much.