Forum Discussion

cmckinney's avatar
cmckinney
Helper IV
5 years ago
Solved

FILTER function using current slicer selection

Is it possible to pass the current selection of a slicer into a FILTER function in a measure? 

 

For example: FILTER(<table>, Column1 = Current Slicer Selection)

9 Replies

  • Hey cmckinney ,

     

    you can use the function SELECTEDVALUE(...) to pass/inject the currently selected value into the FILTER function like so:

    FILTER(<table>, Column1 = SELECTEDVALUE('tablename'[colum used in  the slicer] , [optional default value]))

     Here you will find some more information about the function: https://dax.guide/selectedvalue/

     

    Hopefully, this provides what you are looking for.

     

    Regards,

    Tom

  • edhans's avatar
    edhans
    Community Champion

    You can use ALLSELECTED([ColumnName]) It is designed to work with slicers. It is intended to work in a CALCULATE() function, so you really don't need the FILTER() function. 

      • edhans's avatar
        edhans
        Community Champion

        Yes, it returns a table, so anywhere you need a table, like MAXX() does, it should work