Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Lexignot
Frequent Visitor

Auto clear selection for the second date slicer

Hello,

 

I have a date slicer with predefined date ranges (Date Slicer #1) and a second slicer with custom date ranges (Date Slicer #2). When I select a predefined date range and clear any previous selection from Date Slicer #2, it displays the appropriate start and end dates matching the predefined date range. However, when I select 'Custom' in Date Slicer #1, choose specific start and end dates in Date Slicer #2, and then select another predefined date range in Date Slicer #1 without clearing the selections in Date Slicer #2, Date Slicer #2 retains the previously selected start and end dates. The previously selected dates must be cleared before selecting a predefined date range to ensure the date ranges align correctly.

 

The interaction is Filter in both directions for both date slicers.

Is there a way to automatically clear the selections in Date Slicer #2, whenever a predefined date range is selected in Date Slicer #1?

Thanks in advance for your help with this!

 

Lexignot_0-1717359912718.png

 

1 ACCEPTED SOLUTION

Thnak you for your message @v-jtian-msft . 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!

View solution in original post

6 REPLIES 6
Lexignot
Frequent Visitor

Hi @v-jtian-msft ,

 

Thanks for your answer. I want the Date Slicer #1 and #2 to be aligned in terms of date range, so they need to filter each other actually (i.e. I don't want the interaaction between them to be "None" as you mentioned in your answer).

Issue:  When I select 'Custom' in Date Slicer #1, choose specific start and end dates in Date Slicer #2, and then select another predefined date range in Date Slicer #1 without clearing the selections in Date Slicer #2, Date Slicer #2 retains the previously selected start and end dates. The previously selected dates must be cleared before selecting a predefined date range to ensure the date ranges align correctly.

Expected behavior: Date Slicer #2 selection should auto-clear when I select a pre-defined date range in Date slicer #1.

 

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?

 

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.

vjtianmsft_0-1717485444861.png

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:

vjtianmsft_1-1717485474105.png

vjtianmsft_2-1717485483039.png

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 @v-jtian-msft ,

 

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?

 

Lexignot_0-1717509132295.png

 

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

  1. 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.

 

  1. 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.

vjtianmsft_0-1717568690449.png

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.

v-jtian-msft
Community Support
Community Support

Hi,@Lexignot 
I am glad to help you.

According to your description, you want to set up a dynamic interaction between two slicers that filter the same field.

After checking the selection of one slicer, clear the selection of the other slicer

If I understand you correctly, you can try the following suggestion.

vjtianmsft_0-1717379773069.png

select visual1>Format>Edit interactions

vjtianmsft_1-1717379788013.png

select Visual2

vjtianmsft_2-1717379801927.png

Now visual1 won't affect visual2. This setting has an effect on the slicer as well.

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.

 

Thnak you for your message @v-jtian-msft . 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!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.