Forum Discussion
How to dynamically pre-set filter in dropdown
Dear community,
i have the following challenge:
- Imagine a single-choice dropdown with reporting periods (e.g. YYYY.MM). Every month there will be a new period available with the most current data. I want my cloud published report to be automatically filtered on that latest period, but still want to offer my users to be able to switch to an older period in the dropdown.
My current solution:
- Open the dashboard in cloud every month and switch the initially selected filter to the latest period manually...
Are there any other ways to solve this?
Many thanks in advance!
Marius
Hi. By default there is no way to execute that exact action. The intention from PowerBi would be using Relative Date filtering. You can read more about that here: https://learn.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
There is another option that would be a custom visual. There is a visual dedicated to preselected rules. It's https://appsource.microsoft.com/en-us/product/power-bi-visuals/insiderscoop1611244107840.powerbi_customviz_preselected-slicer?tab=Overview
You can read more about it in this spannish posts: https://github.com/PiConsulting/Pensadero/tree/master/Bi/Resoluciones/Preselected%20slicer
I hope that helps,
2 Replies
- ibarrau
Super User
Hi. By default there is no way to execute that exact action. The intention from PowerBi would be using Relative Date filtering. You can read more about that here: https://learn.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range
There is another option that would be a custom visual. There is a visual dedicated to preselected rules. It's https://appsource.microsoft.com/en-us/product/power-bi-visuals/insiderscoop1611244107840.powerbi_customviz_preselected-slicer?tab=Overview
You can read more about it in this spannish posts: https://github.com/PiConsulting/Pensadero/tree/master/Bi/Resoluciones/Preselected%20slicer
I hope that helps,
- ZikoPowerBI
Helper II
You can achieve it using the below method :
1: create a custom column :Date_DISPLAY= If (date= MAx(Date),'Latest Date', Date)
2: covert this custom column to text.
3: USe the above custom column in the slicer and sort it in descending order.Select Latest date and save the application and deploy.
after every refresh it will select teh latest date and eventually your report will show latest dates data