Forum Discussion
Dynamic default slicer
- 1 year ago
Hi Manish1198 ,
Thank you for reaching out to Microsoft Fabric Community.
By default, Power BI does not support programmatically setting a default selection in slicers.
However, you can achieve a dynamic slicer experience using bookmarks. I have attached a sample .pbix file by using this approach. After publishing the report to the Power BI Service, the default view will appear as intended. If users wish to access a version of the report with the full slicer for multiple selections, they can do so by clicking the provided navigation buttons.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thank you!!
Hi Manish1198 ,
You can’t set a default slicer value dynamically in visuals directly, but here’s a workaround for both cases:
Case 1 – Least Open Month:
Create a measure like:
LeastOpenMonth =
CALCULATE(
MIN('Table'[Month-Year]),
'Table'[Status] = "Open"
)Case 2 – Most Recent Closed Month:
RecentClosedMonth =
CALCULATE(
MAX('Table'[Month-Year]),
'Table'[Status] = "Closed"
)Then create a calculated column:
IsDefault =
VAR _open = [LeastOpenMonth]
VAR _closed = [RecentClosedMonth]
RETURN
IF('Table'[Month-Year] = _open || 'Table'[Month-Year] = _closed, 1, 0)Use this column to filter the slicer to show only the default value.
This doesn’t auto-select the value in the slicer, but it limits the slicer to just that value — which works like a default.
Let me know if you want to switch between the two cases dynamically.
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
translation and formatting supported by AI