Forum Discussion
Hide future year(s) from slicer visual
- 3 years ago
The funny thing is that for me the filter pane does not provide a "Relative date" option probably because Power BI reads my "Year" (dData[Ano]) column as integers values, not as actual dates.
But the good news is that I reached a solution by creating the calculated table below with GENERATESERIES.
I then connected the above 'Ano Slicer' table to the date table through dData[Ano] via a one-to-many relationship and when I placed it on the slicer's field pane, voilá, I now have my slice with only the years I want!
My mistake before was that I was replicating this code as a measure, but the slicer's field pane apparently only accepts table columns as data arguments.
Hi leolapa_br
Certainly. It is better to do it dynamically as you said for easier maintenance. What about setting the filter type as "Relative date" as shown below?
The funny thing is that for me the filter pane does not provide a "Relative date" option probably because Power BI reads my "Year" (dData[Ano]) column as integers values, not as actual dates.
But the good news is that I reached a solution by creating the calculated table below with GENERATESERIES.
I then connected the above 'Ano Slicer' table to the date table through dData[Ano] via a one-to-many relationship and when I placed it on the slicer's field pane, voilá, I now have my slice with only the years I want!
My mistake before was that I was replicating this code as a measure, but the slicer's field pane apparently only accepts table columns as data arguments.