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
That is a measure, I can't use that in a relative filter for the page or the report. Thanks for trying!
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.
- Greg_Deckler8 years ago
Community Champion
Anonymous- The relative date slicer doesn't work that way. You can do Last x Years (current date to current date) or Last x Years (Calendar) but not what you are asking. Therefore, you are going to have to change the filter context of your visual(s). Easiest thing to do would be to use Year (Calendar) mode and then just wipe out anything that is greater than TODAY().
- dbhudia6 years ago
Advocate I
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