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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Restrict Date Range outside the given dates in Date Slicer

Hi Team,

 

we have requirement where we need to show date slicer which will have dates starting from 01-January of current year till today. So as of now, it should show only dates from 01-Jan-2019 to 15-Nov-2019. For this, we have created Calender table in Power BI that has below formula in Power Query to select range from current year till today.

 

= {Number.From(#date(Date.Year(DateTime.LocalNow()), 1, 1))..Number.From(#date(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()), Date.Day(DateTime.LocalNow())))}

= Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)

= Table.TransformColumnTypes(#"Converted to Table",{{"Column1", type date}})

 

However, when we bind it to date slicer, user can still select dates beyond the given range. I.e User can select dates prior to 2019 as well as dates beyond today.  Please see below screenshot.

 

We need to restrict user dynamicaly as per current year. So if when we enter Year 2020, user shouldn't be able to select any date range prior to 01-Jan-2020.

 

 

Please suggest how can we restrict user not to select dates beyond given ranges.

0 REPLIES 0

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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