Forum Discussion
Adding a visual, (count distinct) filter to all visuals
Hi
I have a visual that is showing data on missing software updates.
The count is distinct
Very basic table looking something like this:
| ComputerName | PatchName |
| ComputerA | PatchA |
| ComputerA | PatchB |
| ComputerA | PatchA |
| ComputerB | PatchG |
| ComputerC | PatchF |
| ComputerC | PatchA |
| ComputerD | PatchH |
| ComputerD | PatchI |
| ComputerE | PatchA |
It gives me this wonderful little table visual:
I then limit the data with a filter removing all with just one patch awaiting:
And that works on my table visual. But I need it to work on all my visuals on that page.
My problem is figuring out how to use that filter or creating a measure that works like my filter on alle the visuals on that page.
Kind regards JGaard
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] ) )
2 Replies
- DataInsightsSuper User
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] ) )- jgaardFrequent Visitor
Option 2 works like a charm. 😉
Thank you very much.