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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
markefrody
Post Patron
Post Patron

Dynamic Filter for Rolling Past, Present, and Future Date Based On Today's Date

Hi,

 

I'm trying to filter the date field to include the following only:

1. Today's date, and

2. All past dates before today's date, and

3. +10 days (into the future) after today's date

So the basis of the dynamic update will be always based on today's date.

Note: I'm using Direct Query as storage mode.

 

Relative date filtering does not have the option to filter get the all the dates as per my criteria above. Appreciate if you can help me with my request.

 

Best regards,

Mark

 

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

Hi @markefrody 

Do you want the date filtered in a visual, slicer, or a calculation?

Based on my knowledge, there is no slicer to achieve this goal directly.

As a workaround, i create a measure, then add this measure in the visual level filter.

Measure = IF(MAX(Sheet5[date])<=TODAY()+10,1,0)

4.png

 

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
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
v-juanli-msft
Community Support
Community Support

Hi @markefrody 

Do you want the date filtered in a visual, slicer, or a calculation?

Based on my knowledge, there is no slicer to achieve this goal directly.

As a workaround, i create a measure, then add this measure in the visual level filter.

Measure = IF(MAX(Sheet5[date])<=TODAY()+10,1,0)

4.png

 

 

Best Regards

Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-juanli-msft 

Hi Maggie,

 

Thanks for the assistance. This works.

 

Best regards,

Mark

The answer in #2 works when the data is not summarized (e.g. in a table), but does not work on other visuals when the data is summarized. For example, when the data is in a bar chart, column chart, or card, it shows the total number of results (42). Is there a way to modify the measure so that it works when the data is summarized?

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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