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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.