cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Anonymous
Not 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.. and "ALL" when everything is selected.

2 ACCEPTED SOLUTIONS
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may learn to use ISFILTERED Function inside the IF Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

@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.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

6 REPLIES 6
v-chuncz-msft
Community Support
Community Support

@Anonymous,

 

You may learn to use ISFILTERED Function inside the IF Function.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Must have missed the actual solution somehow.  No doubt this is great advice, but something a bit more detailed and specific might actually be helpful.

@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.


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Thank you for sharing such an elegant solution.

 

Can you think of an equally elegant solution to incorporate an "All Except" rule? For example, I could have a filter with upto 30 different objects, and it could be I want to include all other than 2 of them. In this case it would be preferential to have the measure return "All Except AAA and BBB".

 

What do you think?

@Agreenwood

Something 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


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Works great, thank you so much.

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors