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
Anonymous
Not applicable

How can i create a date filter that looks back from today minus 365

I am trying to create a date filter so  that the  Gateway refresh should pull all data in the data model. In the report layer, the filter date should return current date minute 365 days rolling to display by default. How can  i go about creating a filter of this nature? any help is appreciated.

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

First create a date table:

Date = CALENDAR("2021,1,1","2022,12,31")

Then use the below measure on the table:

FILTER = IF(MAX('Date'[Date])<=TODAY()&&MAX('Date'[Date])>=TODAY()-365,1,0)

 

Then create slicer like the below:

vluwangmsft_0-1659420332554.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

First create a date table:

Date = CALENDAR("2021,1,1","2022,12,31")

Then use the below measure on the table:

FILTER = IF(MAX('Date'[Date])<=TODAY()&&MAX('Date'[Date])>=TODAY()-365,1,0)

 

Then create slicer like the below:

vluwangmsft_0-1659420332554.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

Anonymous
Not applicable

When i create this calendar table do i need to join it to my model?

Hi @Anonymous ,

Yes ,create relationship between your table and slicer table.

 

 

Best Regards

Lucien

lbendlin
Super User
Super User

lbendlin_0-1659201282844.png

 

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.