Forum Discussion
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)
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.
9 Replies
- TomMartensSuper User
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
- edhansCommunity 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.