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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.