Forum Discussion

jhaast's avatar
jhaast
Helper II
5 years ago
Solved

Dynamic year filter

Hi People,   Currently, I create visualisations and yearfilters in PBI desktop.  After uploading those reports to PBI Service I select e.g. the year 2020 and pin a visualisation to an dashboard. ...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    5 years ago

    Hi, jhaast 

     

    Yes, you can. You don't need to use slicer. You can use a measure in the filterpane of the visuals you want to pin to the dashboard, then it will change dynamically.

    Like this:

    Measure =
    VAR a =
        YEAR ( TODAY () )
    RETURN
        IF ( VALUES ( 'Table'[Year] ) IN { a, a - 1, a - 2 }, 1, 0 )
    //if you use date ,you can try:IF ( Year ( 'Table'[Date] ) IN { a, a - 1, a - 2 }, 1, 0 )

    If it doesn’t solve your problem, please feel free to ask me.

     

    Best Regards

    Janey Guo

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.