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
julesdude
Post Partisan
Post Partisan

Date slicer in report to default to the latest available date when the report opens

Hi,

 I know the answer to this used to be no, but wondered if any updates recently have changed this.

I have a report with a date slicer showing from and two dates that can be selected/chosen. The date slicer is linked to dates of records in my one table in my data model - very simple.

Can the report open to show the latest date where records are available and the 'to' date slicer default to that date rather than it having to be manually changed each time?

Or is there a workaround to inplement this?

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @julesdude ,

 

The report shows whether the latest date available for records refers to the current date. You can try using Preselected Slicer, but for vertical lists.

1. Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_0-1691634573723.png

2. First , we need to create a table with one column , and the value is True and False,.

vyangliumsft_1-1691634573725.png

3. Second , we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.

Flag =
var _date =SELECTEDVALUE('Table'[Date])
return
IF(_date = TODAY() , TRUE(),FALSE())

4. Then we can put the 'Table'[Date] in the Fields , [Flag] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:

vyangliumsft_2-1691634595957.png

5. Result:

vyangliumsft_3-1691634595959.png

 

 

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @julesdude ,

 

The report shows whether the latest date available for records refers to the current date. You can try using Preselected Slicer, but for vertical lists.

1. Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

vyangliumsft_0-1691634573723.png

2. First , we need to create a table with one column , and the value is True and False,.

vyangliumsft_1-1691634573725.png

3. Second , we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.

Flag =
var _date =SELECTEDVALUE('Table'[Date])
return
IF(_date = TODAY() , TRUE(),FALSE())

4. Then we can put the 'Table'[Date] in the Fields , [Flag] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:

vyangliumsft_2-1691634595957.png

5. Result:

vyangliumsft_3-1691634595959.png

 

 

Best Regards,

Liu Yang

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.