Forum Discussion
Select / deselect (toggle) 1 specific customer on / off in a simple way
- Anonymous7 years ago
Hi Rygaard
So you need the default view to be all customers, where you can include/excluse 1 specific customer with a toggle button. I've had this exact problem before, I simply solved it by doing the following:
- Create a new column in your data with the following DAX: NewColumn = IF(CustomerName = "Customer X"; "Customer X"; "All Customers").
Now you can create a slicer with this column. The slicer will have 2 values. The "All Customers" value should be ticked by default, where the "Customer X" should not be ticked by default, therefore not including it in the data. Once it is ticked it will include all customers including Customer X.Let me know if this helps!
- 7 years ago
The method with the calculated column is generally something you would do in a dimension table. A table containing only the 10000 distinct customers and their customer related data. If you start creating several column in you main sales table you will proberbly get performance issues eventually.
Hi Rygaard
So you need the default view to be all customers, where you can include/excluse 1 specific customer with a toggle button. I've had this exact problem before, I simply solved it by doing the following:
- Create a new column in your data with the following DAX: NewColumn = IF(CustomerName = "Customer X"; "Customer X"; "All Customers").
Now you can create a slicer with this column. The slicer will have 2 values. The "All Customers" value should be ticked by default, where the "Customer X" should not be ticked by default, therefore not including it in the data. Once it is ticked it will include all customers including Customer X.
Let me know if this helps!
this is stupid simple ill use it :)
Though i still feel it do not solve real issue in Power Bi .. deselecting stuff.... I have over 2 million lines, where i now add a collum I feel from a Data Base point of view, that this is a bad solution... but right now i think its the best i have...
The solotion I had come up with before this was
1) create a filter on the page, then copying this to a new page with nothing on it but this filter, and syncing the filter
2) making sure the filter did not interact with any oter filters on the front page (Edit Interactions)
3) on the new filter page set up 2 bookmarks that did not change page
4) hidding the filter on the front page
5) hidding the filter page
6) making 2 buttons on front page that linked to the two bookmarks, that then activated either the include or exclude bookmark
I really like this solution since it was 2 buttons on the front page, the down side is that i cannot see if its on / off.
- tex6287 years ago
Community Champion
The method with the calculated column is generally something you would do in a dimension table. A table containing only the 10000 distinct customers and their customer related data. If you start creating several column in you main sales table you will proberbly get performance issues eventually.
- tex6287 years ago
Community Champion
Another tip,
If you want to show that a bookmark button is selected, add another shape and then toggle visibility between them to change the color:
UnselectedSelected
Two shapes, placed ontop of eachother.