Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filter group

Hi all,   I have one I am struggling to even explain so I hope this little diagram might help.  There is data that I want to be able to filter with a slicer but some of it is in more than one filt...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    You can create a new table to put the slicer.

     

    Then create a measure.

    New Column = 
    SWITCH (
        SELECTEDVALUE ( 'Table (2)'[Slicer] ),
        "Filter 1 = Show only Type 1", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 1" ) ),
        "Filter 2 = Show both Type 2 AND Type 3",
            CALCULATE (
                SUM ( 'Table'[Column1] ),
                FILTER ( 'Table', [Column2] = "Type 2" || [Column2] = "Type 3" )
            ),
        "Filter 3 = Show only Type 3", CALCULATE ( SUM ( 'Table'[Column1] ), FILTER ( 'Table', [Column2] = "Type 3" ) )
    )

     

    The result is as follows.

     

     

    You can check more details from here.

     

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.