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
artblakey
Helper I
Helper I

Date in slicer (between dates) to default to last date in table

Hello,

 

I am using a slicer (between dates) where it lets the user select two dates (from and to).  But I would like this slicer to default both dates to the last date available on my table (Trade Date).  From there the user will still have the ability to change the date range, but I would like the default dates to be the last dates with available data.

 

Thanks in advance.

2 ACCEPTED SOLUTIONS
jdbuchanan71
Super User
Super User

I assume you are working with a date table?  If so you can add a calculated column to is, something like.

In Data = 
VAR _StartDate = MIN ( Table[Trade Date] )
VAR _EndDate = MAX ( Table[Trade Date] )
Return Calendar[Date] >= _StartDate && Calendar[Date] <= _EndDate

Then you add this field as a filter on your date slicer and set it to only show where  In Data = True and that will limit the date range on the slicer to be just the full range with data.

View solution in original post

amitchandak
Super User
Super User

@artblakey , I doubt you have a way to default slicer end to max date. There are workarounds like.

You have a calendar that ends at max date

 

Calendar = Calendar(Min(Table[Date]),Max(Table[Date]))

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@artblakey , I doubt you have a way to default slicer end to max date. There are workarounds like.

You have a calendar that ends at max date

 

Calendar = Calendar(Min(Table[Date]),Max(Table[Date]))

jdbuchanan71
Super User
Super User

I assume you are working with a date table?  If so you can add a calculated column to is, something like.

In Data = 
VAR _StartDate = MIN ( Table[Trade Date] )
VAR _EndDate = MAX ( Table[Trade Date] )
Return Calendar[Date] >= _StartDate && Calendar[Date] <= _EndDate

Then you add this field as a filter on your date slicer and set it to only show where  In Data = True and that will limit the date range on the slicer to be just the full range with data.

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.