Forum Discussion

Zaky's avatar
Zaky
Helper IV
4 years ago
Solved

Need Help

Hi   I have created a line chart where it can compare the trends for 2 years. For this line chart, I want it to remain trending for 2 years without changing either if I choose any reporting year. ...
  • halfglassdarkly's avatar
    4 years ago

    Hi Zaky, you can disable the effect of the year slicer on that visual.

     

    • Under format click on Edit Interactions
    • Select your year slicer (click on the bounding box)
    • Click on the None filter icon (circle with diagonal strike through) for the visual that you don't want filtered by the slicer.
    • Click the Edit Interactions button again to exit edit mode

     

     

    You can then either filter your visual manually to the years you want using the filter pane, or do this dynamically.

     

    Assuming you have a column for year in your table which you're using for your legend, you could use something like this to filter your measure to current + previous year.

     

    Measure =
    //create variable to store current year
    Var CurrentYear = year(now())
    RETURN
    if(max('Master'[Year]) in{CurrentYear,CurrentYear-1},CALCULATE(COUNT('Master'[Incident ID])))