Disconnected Table with DAX Measure using SWITCH() and SELECTEDVALUE() will help you achieve this.
1. Slicer Table:
Create an empty table with just a single column named ''Time Periods.'' Within its rows, insert the following values:
Current Year
Last Year
Last 3 Years
Last 5 Years
Again, this doesn't relate to the data model in your report.
2. Create a DAX Measure
Use SWITCH() For the selected filter:
SalesFiltered =
VAR SelectedPeriod = SELECTEDVALUE('Time Periods'[Period Name])
RETURN
SWITCH(
SelectedPeriod,
"Current Year", CALCULATE([Total Sales], YEAR('Sales'[Order Date]) = YEAR(TODAY())),
"Last Year", CALCULATE([Total Sales], YEAR('Sales'[Order Date]) = YEAR(TODAY()) - 1),
"Last 3 Years", CALCULATE([Total Sales], 'Sales'[Order Date] >= DATE(YEAR(TODAY()) - 3, 1, 1)),
[Total Sales] -- Default case
)
3. Add Slicer & Use Measure