Forum Discussion
Anonymous
9 years agoNot applicable
Text field to show the selected filter
How could I show what multiple filters are selected on a report page? There are date filters and categorical filters. I want the label to show everything that currenlty selected at al times....
- 9 years ago
- 9 years ago
roundwound Anonymous
I would use a measure structured something like this:
Filters Selected = IF ( ISFILTERED ( MyTable[MyColumn] ), CONCATENATEX ( FILTERS ( MyTable[MyColumn] ), MyTable[MyColumn], ", " ), "ALL" )The reason for using FILTERS is because it returns direct filters on the specified column, as opposed to VALUES which would return the values visible in a column incorporating cross-filtering from other columns.
OwenAuger
Super User
7 years agoSomething along these lines
Filters Selected (All Except version) =
IF (
ISFILTERED ( MyTable[MyColumn] ),
VAR ExcludedValues =
EXCEPT ( ALL ( MyTable[Column] ), FILTERS ( MyTable[MyColumn] ) )
RETURN
"All Except " & CONCATENATEX ( ExcludedValues, MyTable[MyColumn], ", " ),
"ALL"
)This would return "All Except AAA, BBB, CCC,..." without an "and" between the last two items.
To include an "and" between the last two items would require a bit more logic: concatenating all but the last excluded item, followed by "and <last item>". Post back if you need help on that aspect.
Regards,
Owen
Agreenwood
Helper I
7 years agoWorks great, thank you so much.