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
alamakota97
Frequent Visitor

Selected Dates on Date Slicer updating automatically

Hi, 
I've found many similar posts but couldn't find anything that works.
I would like to create Slicer on which you can see Date hierarchy and slicer would automatically update to have 30 days selected till most recent date. 

For example: Today I refresh my data (07.02.2022) so on slicer days from 10/01/2023 till 07/02/2023 will be selected and all other dates are also seen on slicer but they aren't selected.

 

I'd be grateful for any help:)

2 REPLIES 2
alamakota97
Frequent Visitor

Hi, 
Thanks for your help, but I want something else without having to install custom visual.

v-cgao-msft
Community Support
Community Support

Hi @alamakota97 ,

 

Try this custom visual:

Preselected Slicer

Preselected Slicer | INSIDERS.COOP Power BI Custom Visuals

Measure = 
VAR _max_date = TODAY()
VAR _min_date = TODAY()-28
VAR _selecteddate = SELECTEDVALUE('Table'[Date])
RETURN
_selecteddate>=_min_date&&_selecteddate<=_max_date

vcgaomsft_0-1675836678386.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

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.