cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aviswana27
New Member

How to create filter for certain number of months?

How can I create a filter that shows only the last 3 months of a date field?  I have a column of data called Created Date and in a specific dashboard/component I want to show data for the last three months.  Instead of manually selecting the last three months every month was hoping to create a formula of some sort so that the dashboard components update each month on it's own.  Is this possible?

 

Thanks,

Arun

2 REPLIES 2
v-caliao-msft
Microsoft
Microsoft

Hi @aviswana27,

 

Create a calculated to check if the date is under the last 3 month or not, and then drag this new created calculated into a slicer visual to filter the data.

Last3Month = IF(AND(YEAR(TODAY())=YEAR('Date'[CalendarDate]),(MONTH(TODAY())-MONTH('Date'[CalendarDate]))<3),"Last 3 month","Other")
Capture.PNGCapture1.PNG

 

Regards,

Charlie Liao

Greg_Deckler
Super User
Super User

MonthsAgo=DATEDIFF(TODAY(),[Created Date],MONTH)

Create as a new column and then use that to filter < 2.

 

If you need year factored in, you might have to do some slighly more complicated calculations.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.