Forum Discussion

cmc099's avatar
cmc099
Frequent Visitor
3 years ago
Solved

Creating visual to show overlap between groups?

I have a table that has the names of people and the groups that they belong to. For example, the table looks like the following:   Worker name Group name John Henderson Economy John Hend...
  • DataInsights's avatar
    3 years ago

    cmc099,

     

    This solution uses a separate table for the visual in order to break the link between slicer and visual. The original table is named Workers.

     

    1. Create calculated table:

     

    WorkersVisual = Workers

     

    2. Create measure:

     

    Visual Filter = 
    VAR vWorkerCountSlicer =
        COUNTROWS ( VALUES ( Workers[Worker name] ) )
    VAR vWorkerGroup =
        TREATAS ( VALUES ( WorkersVisual[Group name] ), Workers[Group name] )
    VAR vWorkerCountInGroup =
        COUNTROWS ( CALCULATETABLE ( VALUES ( Workers[Worker name] ), vWorkerGroup ) )
    VAR vResult =
        IF ( vWorkerCountSlicer = vWorkerCountInGroup, 1 )
    RETURN
        vResult

     

    3. Create a slicer using Workers[Worker name].

     

    4. Create a table visual using WorkersVisual[Group name].

     

    5. Add the measure Visual Filter to the table visual as a filter:

     

     

    Result:

     

    ---

     

    ---