Forum Discussion
List slicer - Show only selected items
- 1 year ago
Hi arawo ,
You can modify your Power BI report to achieve the desired slicer functionality. While there isn't a direct, single-click setting for this, you can create a slicer that shows all articles when nothing is selected and then dynamically updates to show only the selected items once a choice is made. This is accomplished by creating a simple DAX measure and applying it as a filter directly to the slicer visual itself.
First, you will need to add a new measure to your model. You can do this by navigating to the Modeling tab and selecting New Measure. In the formula bar, you should enter the following DAX expression, making sure to replace 'YourTable' and [Article] with the actual names of your table and the article column you are using in the slicer.
SlicerFilter = IF(ISFILTERED('YourTable'[Article]), 1, 0)After creating this measure, select the slicer visual in your report canvas. With the slicer selected, go to the Filters pane. Drag the SlicerFilter measure you just created into the "Filters on this visual" section. Once it's there, expand its options and set the filter condition to is 1. This configuration makes it so the measure returns a 1 whenever the article list is filtered. By filtering the slicer visual to only show when the measure is 1, it effectively hides the unselected items as soon as a selection is made. If you clear the selection, the condition is no longer met, and the slicer reverts to showing the full list of all articles.
Regarding your alternative question, having selected items appear at the top of the slicer is the default behavior in Power BI. When you select any item in a list slicer, Power BI automatically moves it to the top of the list and displays a faint line to separate it from the unselected items below. You do not need to configure any special settings to enable this functionality. If you are not observing this behavior, you may want to ensure your version of Power BI Desktop is up to date.
Best regards,
Hello, arawo ,
I don'T there's option to have selected stuff on top, at least not dynamically. So I am wondering how do you imagine the native slicer working, naturally you can keep only the stuff you click and remove the rest, but that would remove everything immedaitelly after you click on option, then you won't have the option to select more stuff, so I was wondering how do you wanna do it.
- arawo1 year agoFrequent Visitor
The idea is that the user will copy data from Excel and paste it into the slicer in PowerBi. Searching for articles manually would take too much time because there are over 5 thousand articles on the list. It will not be a problem if after selecting an item from the list everything disappears, because normally no one should do it manually.
Also if you paste an article from Excel, you will have what you were looking for highlighted. Without this, you would have to manually search for what was selected which would be not cool