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 IV
Super User IV

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!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




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

Proud to be a Super User!




Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors