Forum Discussion

Johann_32's avatar
Johann_32
Advocate II
1 year ago
Solved

Dynamic Years

Hello Experts, I would need your support in a report that has a special requirement on showing years dynamically.   Description of Requirement: In the charts of the reports, there should ALWAYS b...
  • johnt75's avatar
    1 year ago

    You could create a couple of measure like

    5 Years Visible =
    VAR CurrentYear =
        MAX ( 'Date'[Year] )
    VAR ChosenYear = [Previous version]
    VAR Result =
        IF ( CurrentYear >= ChosenYear && CurrentYear <= ChosenYear + 5, 1 )
    RETURN
        Result
    

    where [Previous Version] is a measure which returns the desired start year according to your logic.

    Apply this measure as a filter on the visuals set to show only when the value is 1.