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
KGuyton
Helper II
Helper II

30, 60, 90 day filter

I am trying to create a measure that will slice a date by 30, 60, and 90 days from current day.  I have an expiration date column and I am trying to create a slicer that lets me show accounts that will be expiring in the next 30, 60, and 90 days from the current day.  Any ideas?

1 ACCEPTED SOLUTION

HI, @KGuyton 

You could try this way as below:

Step1:

Add a simple table that only contains 30,60,90 value for slicer.

For example:

In the example, I use a simple data sample

6.JPG

Step2:

Then add this conditional in your formula

Measure = CALCULATE(SUM('Table'[Value]),
FILTER('Table','Table'[Date]<=TODAY()+SELECTEDVALUE(Days[Days after],MAX(Days[Days after]))))

Result:

7.JPG

here is sample pbix file, please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
Greg_Deckler
Super User
Super User

If the data is updated everyday the simplest method is to create a calculated column that contains the designation 30, 60, 90 days. Then you can use this calculated column in a slicer.

 

If you are in the situation where you need this to be 100% dynamic, then you need to use the Disconnected Table Trick. As this article demonstrates: https://community.powerbi.com/t5/Community-Blog/Solving-Attendance-with-the-Disconnected-Table-Trick...


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I am not sure how to create such a table.

 

update:  I went ahead and created a new table with a period that I was able to add a relationship to my existing calendar using this code: 

 

DatePeriod =
UNION (
ADDCOLUMNS( SUMMARIZE( CALCULATETABLE('Date' , DATESBETWEEN('Date'[Date],today(),today()+30) ), 'Date'[Date]),"Period","Next 30 Days") ,
ADDCOLUMNS( SUMMARIZE( CALCULATETABLE('Date' , DATESBETWEEN('Date'[Date],today(),today()+60) ), 'Date'[Date]),"Period","Next 60 Days") ,
ADDCOLUMNS( SUMMARIZE( CALCULATETABLE('Date' , DATESBETWEEN('Date'[Date],today(),today()+90) ), 'Date'[Date]),"Period","Next 90 Days") )

HI, @KGuyton 

You could try this way as below:

Step1:

Add a simple table that only contains 30,60,90 value for slicer.

For example:

In the example, I use a simple data sample

6.JPG

Step2:

Then add this conditional in your formula

Measure = CALCULATE(SUM('Table'[Value]),
FILTER('Table','Table'[Date]<=TODAY()+SELECTEDVALUE(Days[Days after],MAX(Days[Days after]))))

Result:

7.JPG

here is sample pbix file, please try it.

 

Best Regards,

Lin

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

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.