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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.