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
Anonymous
Not applicable

Need to have date slider load to current date when report is opened

I have a between date slicer and I need it to load to the most current date when the report is open. I also need to be able to still select a different date in the past as well. Is there a workaround that allows you to anchor a slicer to the current date

1 ACCEPTED SOLUTION

Hi @Anonymous ,

You could create a new date table and a measure to implement it. Please reference  the steps to have a try.

  • Create a calendar table
Calendar = CALENDARAUTO()

No relationshipNo relationship 

  • Create a measure
Measure = 
var a = SELECTEDVALUE('Calendar'[Date])
var b = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = a))
var c = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = TODAY()))
return
IF(ISFILTERED('Calendar'[Date]),b,c
)

List slicerList slicer

Measure 2 = 
var b = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] >= MIN('Calendar'[Date]) && 'Table'[Date] <= MAX('Calendar'[Date]) ))
var c = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = TODAY()))
return
IF(ISFILTERED('Calendar'[Date]),b,c
)

Between slicerBetween slicer

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

I need something that will work with my current slicer. I need for when the report opens to display the data for today but still be able to go back and look at the data for say 01/02/2020 for example

Hi @Anonymous ,

You could create a new date table and a measure to implement it. Please reference  the steps to have a try.

  • Create a calendar table
Calendar = CALENDARAUTO()

No relationshipNo relationship 

  • Create a measure
Measure = 
var a = SELECTEDVALUE('Calendar'[Date])
var b = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = a))
var c = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = TODAY()))
return
IF(ISFILTERED('Calendar'[Date]),b,c
)

List slicerList slicer

Measure 2 = 
var b = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] >= MIN('Calendar'[Date]) && 'Table'[Date] <= MAX('Calendar'[Date]) ))
var c = CALCULATE(SUM('Table'[ Sales]),FILTER('Table','Table'[Date] = TODAY()))
return
IF(ISFILTERED('Calendar'[Date]),b,c
)

Between slicerBetween slicer

Best Regards,

Xue Ding

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.