Forum Discussion
Auto clear selection for the second date slicer
- 2 years ago
Thnak you for your message Anonymous . I solved the problem using a relaive date slicer, so tat I only have one slicer and I can get the relative date ranges I need.
Thanks!
Hi,Lexignot .
Thank you for your reply.
Based on your description I suggest you try the following suggestions
1.Recreate a date table for the second slicer, which is filtered against the main table, but not related to the date table used by the first slicer
like this.
2. If you don't want to create the relationship manually, you can also achieve the effect of filtering the slicer by creating a MEASURE (the selection of this slicer will also not affect other slicers)
like this:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Thanks for sharing this but I don't think this answer my problem. Please see attached (link) my dashboard and below a picture illustrating the problem: today's date is June 6 in my local time and you can clearly see the time range difference between the two date slicers if I don't clear the selection in the Date slicer #2.
Hence my initial question, is there a way to automatically clear the selections in Date Slicer #2, whenever a predefined date range is selected in Date Slicer #1?
- Anonymous2 years agoNot applicable
Hi,Lexignot
Thank you for your replay.I am sorry that I didn't understand your requirement and gave you wrong suggestion.
According to your description you want the second slicer to automatically filter based on the current date when you open the report file, but now the maximum time for the second slicer is the time since the last save i.e. May 31st, not June 6th (my current time is June 5th).
You now want the slicer's default selections to dynamically change based on the current date, instead of having to click “Clear selections” to manually get the latest date.
Here are my suggestions, you may refer to them- Publish the latest report to the service after clicking “Clear selections”, (I'm not sure if this works, but the service will usually keep the final status of the report), you can refresh the report on the service to see if it works. You can refresh the report on the service to see if it works.
- Change the slicer type
To be on the safe side, please create a new slicer and set the slicer type to “Relative Date”.
With this setting the slicer will dynamically change based on the actual latest date instead of using the “between” type.
like this.
I would actually prefer that you write DAX code to dynamically change the default filters on slicer (to flag the latest date) but there is no way to set the measure on the slicer.(I think it's a direction we can try)
Looking forward to your reply.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.