Use year selected from card filter



I'm using a dropdown list that selects year values, I want to use the value selected to created a calculation. Is it possible to use the year selected?

For example if in my dropdown list I selected year 2023, then use this value to do a year previous revenues sum


Best Answers

  • ColemenWilson
    Answer ✓

    You could explore using a variable to accomplish this:

    If I solved your problem, please select "yes" above

  • marcel_luthi
    marcel_luthi Coach
    Answer ✓

    As @ColemenWilson suggested, once you have the year as a variable, you can make your cards show all time, and then create a Beast Mode to use as a filter instead, which would look something like:

    CASE WHEN YEAR(`date_field`) = `variable_name` THEN 'show' ELSE 'hide' END 

    And make it so that you filter only to the show value. (if you want the year previous to the one selected you can just update the formula to be YEAR(`date_field`) + 1 = `variable_name` instead)