Dynamic Years

hi i want to display data of Year in below format:

Current year to -5

2025
2024
2023
2022
2021..

what should i do to get work year in control record like this.. what should i follow to get like this.. i want to only display list of years from current to current-4

Hi @suvarna0212 , Thanks for your question.

If your dataset include “Date” field then you can create a calculated field using Extract() function, convert this calculated field into a dimension and then add as a filter on top of your sheet.

Sample:

  • Dateset Field - DATE
  • Calculated field - extract('YYYY', DATE)
  • If your dateset includes dates between 2022 - 2025 then output filter will be a dropdown of just years value.

Hope this helps!
I am marking this reply as, “Solution,” but let us know if this is not resolved. Thanks for posting your questions on the QuickSight Community!

hi.. i dont want to give a calculated field.. just display latest 5 years and map it to a field to filter the data

Hi @suvarna0212

If the last 5 years is all that needs to be there in the dashboard for analysis why don’t you filter the data in the dataset for latest 5 years alone.

There is no need to do anything special in the analysis then.

Regards,
Giri