Forum Discussion

jgaard's avatar
jgaard
Frequent Visitor
4 years ago
Solved

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 Pa...
  • DataInsights's avatar
    4 years ago

    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] )
    )