Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Synik
Helper II
Helper II

Dynamic list of all applied filters

Hello all, I'm looking for some help in what I'd have assumed would have been an easy or built-in feature. Lets me give an example, lets say I have 5 columns: 

State
City
Date
Price
Name 

All of these are available slicers. Would I would like to display, either in a card visual or a texbox (if possible), is to have a dynamically changing list of applied filters.

With no filters applied, it might display something like “Filters = None”

If 2 are chosen it would be something like
“Filters =
State = New York
Name = John Smith”

Is something like this possible? I work with Cognos and that by default displays filters at the top. Just looking for something similar here outside of the Filter pane.

Thank you!

 

2 ACCEPTED SOLUTIONS
az38
Community Champion
Community Champion

Hi @Synik 

try a measure like

Measure = 
var _city = IF(ISFILTERED('Table'[City]), CONCATENATE("
City = ",MAX('Table'[City])), "")
var _date = IF(ISFILTERED('Table'[Date]), CONCATENATE("
Date = ",MAX('Table'[Date])), "")
var _name = IF(ISFILTERED('Table'[Name]), CONCATENATE("
Name = ",MAX('Table'[Name])), "")
var _price = IF(ISFILTERED('Table'[Price]), CONCATENATE("
Price = ",MAX('Table'[Price])), "")
var _state = IF(ISFILTERED('Table'[State]), CONCATENATE("
State = ",MAX('Table'[State])), "")
var _text = CONCATENATE(_city,CONCATENATE(_date, CONCATENATE(_name,CONCATENATE(_price,_state))))
return
IF(_text <> "", CONCATENATE("Filter = ", _text), "Filters = None")

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

az38
Community Champion
Community Champion

@Synik 

Yes, I've thought over it when wrote this statement.

you can try to play with UNICHAR() function https://docs.microsoft.com/en-us/dax/unichar-function-dax

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

9 REPLIES 9
az38
Community Champion
Community Champion

Hi @Synik 

try a measure like

Measure = 
var _city = IF(ISFILTERED('Table'[City]), CONCATENATE("
City = ",MAX('Table'[City])), "")
var _date = IF(ISFILTERED('Table'[Date]), CONCATENATE("
Date = ",MAX('Table'[Date])), "")
var _name = IF(ISFILTERED('Table'[Name]), CONCATENATE("
Name = ",MAX('Table'[Name])), "")
var _price = IF(ISFILTERED('Table'[Price]), CONCATENATE("
Price = ",MAX('Table'[Price])), "")
var _state = IF(ISFILTERED('Table'[State]), CONCATENATE("
State = ",MAX('Table'[State])), "")
var _text = CONCATENATE(_city,CONCATENATE(_date, CONCATENATE(_name,CONCATENATE(_price,_state))))
return
IF(_text <> "", CONCATENATE("Filter = ", _text), "Filters = None")

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 
So moving past the example into my real world report - I have about ~15 filters. I should set them all up in the same format you listed and throw that measure into a card visual? 

az38
Community Champion
Community Champion

@Synik 

I'm sure it's not the best idea, but so far I don't see anything better


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 
Thank you very much. Its doing exactly as I explained. One more hopefully easy thing - is there a DAX notation for line breaks? I'd see if I can throw one of those in there after the returned true IF text to put each new applied filter on a new line. 

az38
Community Champion
Community Champion

@Synik 

Yes, I've thought over it when wrote this statement.

you can try to play with UNICHAR() function https://docs.microsoft.com/en-us/dax/unichar-function-dax

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 
I got the line breaks working by putting in UNICHAR(10) into the var delcarations, inside the MAX area. 

Another question, if I select multiple of the same filters using CTRL (Like multiple names for example), the filters display a single line. If there a way around this? I believe its the MAX that is affecting this. 

az38
Community Champion
Community Champion

@Synik
How does it should look like according your business logic?

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 

For example if a user chooses multiple states via the CTRL selection option. it would display something like this: 

Filters  = 
State = New York, California, Texas, Florida 
Name = John Smith, Carol Baskins

Essentially putting all instances of a multiple selection on the same line. 

Any idea if this is possible? 

camargos88
Community Champion
Community Champion

Hi @Synik ,

 

Perhaps something like:

 

Get selected values with VALUES function and concate them

 

Measure =
VAR _clienteID = VALUES('Table'[ClientID])
VAR _consective = VALUES('Table'[Consecutive])
RETURN CONCATENATE(CONCATENATEX(_clienteID; 'Table'[ClientID]; "; "); CONCATENATEX(_consective; 'Table'[Consecutive]; "; "))
 
Ricardo


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.