Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello,
I would like to ask you for help in setting up the list slicer. In my report I have a table with all the articles stored in my warehouse and current stock of the articles. Sometimes I want to check the stock of one of article so I added the list slicer to the report and I allowed multiple selection so if I need to check for example 3 articles, I just copy the list to the slicer and PowerBi will automatically select the articles. The thing is the table has over 5000 articles so does the slicer, so if 3 articles of total are selected then I don't what was selected on the slicer because they are not necessarily on the top of the list in the slicer.
My question is, is there a way to change the slicer setting to show all the articles if nothing is selected but If minimum one article is selected then show only selected items in the slicer list? And if all the articles are unselected then show again the whole list?
If option show only selected items its not possible, would option b be possible? is there a slicer setting so that selected items appear at the top of the list, and unselected ones below them?
FYI, I checked the Preselected slicer plugin and it works very well, but with a table with a lot of data, every time I select and deselect an article in the slicer, the report lags a lot, that's why I'm looking for some alternatives
Thanks in advance for your help
Hi @arawo ,
Since there is no direct method to do this, the workaround suggested by @DataNinja777 will help you with your result and this method will work when slicer 1 has the filter set to 1 and other doesnt.
I tried reproducing the scenario and below is the result.
If you deselect all items will appear.
Attached file for reference.
Hope this helps!
If the response has addressed your query, please Accept it as a solution so other members can easily find it.
Thank You!
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,
I guess I didn't fully understand what I had to do. I added a new measure, added a "slicer" (not a text slicer, not a list slicer, just a slicer) and added my measure to Filters on this visual, but then unfortunately I can't change the filter condition, they remain "is less than" and the function is kind of blocked.
I managed to do it I guess. Your method works, but I don't know if I set it up correctly.
In the first slicer I added a measure as you suggested and set the Filters on this visual measure = 1. I added a second slicer and there after pasting the article number in the first slicer the pasted numbers are selected and only they are on the list.
I don't think that what you're looking for is possible, but you could create a measure to show which items are selected and put that in a card visual or something. Something like
Selected Items =
IF (
ISFILTERED ( 'Table'[Column] ),
CONCATENATEX ( VALUES ( 'Table'[Column] ), 'Table'[Column], ", " ),
"All Articles"
)
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.
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
User | Count |
---|---|
84 | |
76 | |
74 | |
48 | |
39 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |