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
taylorb
Helper I
Helper I

Default Date Filter to Past and Future Dates

I have a filter in the filter pane for dates and I am trying to default it to the past 3 months, current month, and two future months. Is there a way to use a relative filter for this rather than picking specific dates? If I pick specific dates then it wont update when the month changes. I am assuming that there is no easy way to do this with the filter pane. I want to use it because we have several report filters and we prefer to keep them all in one spot.

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

Hi, @taylorb 

 

According to your description,I think you can create a measure, then use it in filter pane.

Like this:

Measure4 = 
VAR a =
    TODAY ()
VAR year =
    YEAR ( a )
VAR month =
    MONTH ( a )
VAR firstday =
    DATE ( year, month, 1 )
VAR b =
    EDATE ( firstday, -3 )
VAR c =
    EOMONTH ( a, 2 )
RETURN
    IF ( VALUES ( 'Table 2'[Date] ) >= b && VALUES ( 'Table 2'[Date] ) <= c, 1, 0 )

8.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @taylorb 

 

According to your description,I think you can create a measure, then use it in filter pane.

Like this:

Measure4 = 
VAR a =
    TODAY ()
VAR year =
    YEAR ( a )
VAR month =
    MONTH ( a )
VAR firstday =
    DATE ( year, month, 1 )
VAR b =
    EDATE ( firstday, -3 )
VAR c =
    EOMONTH ( a, 2 )
RETURN
    IF ( VALUES ( 'Table 2'[Date] ) >= b && VALUES ( 'Table 2'[Date] ) <= c, 1, 0 )

8.png

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

amitchandak
Super User
Super User

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.