Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Display Current Selected year vs Previous year

I have data similar to the one below I would like to use a year slicer to control a stacked Column chart. I have one stream that has data from 2020 - 2022 with scores for two subjects Maths & Engl...
  • v-easonf-msft's avatar
    v-easonf-msft
    4 years ago

    Hi, Anonymous 

    Try steps as below:

    1.create/enter a seperate table 'Slicer' as below:

    Slicer = VALUES('Date'[Year])

    2. add a measure as below and apply it to visual filter pane

    filter control = 
    VAR a =
        IF (
            MAX ( 'Date'[Year] ) = MAX ( Slicer[Year] )
                || MAX ( 'Date'[Year] )
                    = MAX ( Slicer[Year] ) - 1,
            1,
            0
        )
    RETURN
        IF ( ISFILTERED ( Slicer[Year] ), a, 1 )

    Best Regards,
    Community Support Team _ Eason