Forum Discussion
Relative date filtering, need last 3 years PLUS YTD.
- 6 years ago
I know this is an old thread but putting this on anyways.
This 'Should' be something relative date could do but sadly doesn't. I created a calculated field on my date table called YearIndex
So the current year is 0 and the prior year is -1. Now you can just use the basic filter to get Current Year and Last year or however many years you want.YearIndex =VAR ThisYear = YEAR(NOW())RETURNDates[Year] - ThisYear
Perhaps something along the lines of:
Measure = CALCULATE(<something>,FILTER(ALL('Calendar'),[Date]>=DATE(YEAR(TODAY())-4,1,1)))- Anonymous8 years agoNot applicable
That is a measure, I can't use that in a relative filter for the page or the report. Thanks for trying!
- Greg_Deckler8 years ago
Community Champion
Anonymous- This is why you need to better explain your data and what exactly you are trying to accomplish. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- Anonymous8 years agoNot applicableOk, let me try again. I need a relative report filter. I have too much data. When using my Calendar table, I am able to do a relative filter, which is nice, but does not do what my users expect. Currently Report Level Filters are on Calendar.ADate, which is type DateTime. Filter Type is relative. Show items when the value: is in the last 4 calendar years. This gives me 1/1/2014 - 12/31/2017. My expect result is that I will see data between 1/1/2014 and today (5/7/2018). Thanks again for your help.