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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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