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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
wpf_
Post Prodigy
Post Prodigy

How to disable selecting old dates on a date slicer?

I have a calendar table which uses calendarauto() and gives me just the dates for the year and use it in a slicer as a date picker.  I am using the calendar picker not the slider or drop down picker.  How can i disable the user from picking dates older then today?  in my calendar table i have a column that only shows dates from today onward.  Older dates show up blank.  And i am using this column in the slicer.  However when i pick an older date, the slicer still shows the older date even though the data is today's date (min).  So this could confuse users.  I am trying to avoid using a slider or drop down.  Thanks. 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @wpf_ 

If you only want to show dates after today in your date slicer, you can try to build a filter measure.

I build a Date table by calendar function.

Date = 
CALENDAR(DATE(2021,01,01),DATE(2021,12,31))

Measure:

Slicer Filter Measure = IF(MAX('Date'[Date])<TODAY(),0,1)

Add this measure into your slicer and set it to show items when the value equal to 1.

1.png

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

View solution in original post

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @wpf_ 

If you only want to show dates after today in your date slicer, you can try to build a filter measure.

I build a Date table by calendar function.

Date = 
CALENDAR(DATE(2021,01,01),DATE(2021,12,31))

Measure:

Slicer Filter Measure = IF(MAX('Date'[Date])<TODAY(),0,1)

Add this measure into your slicer and set it to show items when the value equal to 1.

1.png

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

amitchandak
Super User
Super User

@wpf_ , if you are using calendar date picker, between range?

I think that is able to show dates in the past even if they are not available. 

@amitchandak 

 

Is there any way to get around this?  Even if i just want to display a messsage that they can't show it? 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.