cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KGuyton Regular Visitor
Regular Visitor

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

Accepted Solutions
Community Support Team
Community Support Team

Re: 30, 60, 90 day filter

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

Re: 30, 60, 90 day filter

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


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

KGuyton Regular Visitor
Regular Visitor

Re: 30, 60, 90 day filter

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") )
Community Support Team
Community Support Team

Re: 30, 60, 90 day filter

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

Helpful resources

Announcements
October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 356 members 3,584 guests
Please welcome our newest community members: