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
Mahi1827
Resolver I
Resolver I

How to show dynamic date range by default and how to reset default date range after report refresh

Hi,

I have a date slicer using currdate column in slicer from date table. as per need need to show date slicer as by default  date range with start date as "current year first date" and end date as "todays date".

 

so i am using below measure and applied on date slicer visual filter as 1. i have tried with both measure and calculated column by using below logic but its not working as expected.


Daterange =
VAR currDate =CALCULATE(MIN('DATE'[currDate]),all('DATE'[currDate]))
VAR minidate= (DATE(YEAR(TODAY()),1,1))
VAR enddate = today()
RETURN
IF ( (currDate)>=minidate && (currDate)<=enddate,1,0 )


when i am trying with above meaure not able to show date range as start is current year first date and end date as todays date in date slicer.


also as  per  need,  if i select any other dates and trying to refresh report i am not able to re set the default date range as start is current year first date and end date as todays date.

 

Please suggest with updated dax/solution or any other approaches.

Thanks in advance for your time and help..


Thanks,
Mahi1827

1 ACCEPTED SOLUTION

Hi amitchandak,

The updated dax logic is working fine as expected. Thank you so much for your time and suggestions.

 

Thanks,

Mahi1827

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Mahi1827 , You will not be able to default range .

You can have a column like this in date table and use it (Filter on YTD)

Is Today = if('Date'[Date]<=TODAY() && year('Date'[Date]) = year(TODAY()),"YTD",[Date]&"")

 

 

Use relative date slicer : https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi amitchandak,

The updated dax logic is working fine as expected. Thank you so much for your time and suggestions.

 

Thanks,

Mahi1827

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.