Forum Discussion
Need help with slicer's default selection
- 1 year ago
hI udas24
Using Tabular Editor, you can leverage the Group by Columns property to "store a filter by using an alternate value, which represents the key of the entity." Power BI uses this key to store the filter, allowing the corresponding filter value in the visual to change dynamically. For instance, if May-24 is selected in the visual and currently has a key of 0, when June arrives, May will shift to a key of 1, and June will take the key of 0. Consequently, the slicer selection will automatically change to June.
Demo: https://www.youtube.com/watch?v=MrEAZREQuXM
Further reading is on the video description.
- Anonymous1 year ago
Hi udas24 , hello danextian, thank you for your prompt reply!
Based on my research, you can use the certified custom visual Preselected Slicer to complete the task.
Follow these steps to create the necessary measures:
Current Period = VAR MaxPeriod = MAXX(ALL(PeriodTable),PeriodTable[Period]) RETURN MaxPeriodIsCurrentPeriod = IF(SELECTEDVALUE('PeriodTable'[Period]) = [Current Period], TRUE(), FALSE())Since the Preselected Slicer requires a Dirty Status field containing Boolean values, you need to create a dummy table.
Dummy = UNION ( SELECTCOLUMNS ( { TRUE }, "Dummy", TRUE ), SELECTCOLUMNS ( { FALSE }, "Dummy", FALSE ) )Result for your reference:
Hope the following article is helpful to you:
Exploring slicer default selections – Owen Auger's BI Blog
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, danextian thanks for your valuable input. Unfortunately I am not looking to work on Tabular Editor at the moment.
Hi Anonymous thank you for the suggestion. I previously came across this Preselected Slicer and wasn't successful in an attempt to make it work however this time after following your steps it worked.
Now, one issue I encounter with this slicer is that it can’t be visually changed to Tile format.
Any thoughts or comments on this?
Thanks.