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.
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!
Solved! Go to Solution.
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")
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
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")
@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
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.
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
@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
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?
Hi @Synik ,
Perhaps something like:
Get selected values with VALUES function and concate them
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
93 | |
75 | |
62 | |
50 |
User | Count |
---|---|
147 | |
107 | |
105 | |
87 | |
61 |