Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Set year filter to default 2022

Hi all,

 

I am stuck with a query. I have a year filter which has 4 different years 2020, 2021, 2022, 2023 I want to set the Year Filter default to 2022. As whenever I open my dashboard it year should be set 2022 irrespective of whichever year we closed the report at. Can anyone help me what needs to be done ?

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi  Anonymous ,

    I created some data:

    Here are the steps you can follow:

    1. Get more visuals – Preselected Slicer.

    2. Enter data – Create a table.

    3. Create measure.

    Flag =
    var _year=SELECTEDVALUE('Table'[Year])
    var _default2022 = YEAR(TODAY())
    return
    IF(_year=_default2022 , TRUE(),FALSE())

    4. Place the fields in the Preselected Slicer as follows.

    5. Result:

    Automatic default 2022

     

    Best Regards,

    Liu Yang

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

2 Replies

  • Shaurya's avatar
    Shaurya
    Icon for Memorable Member rankMemorable Member

    Hi Anonymous,

     

    Create a bookmark with year set to 2022. Add a landing page for your report and a button with Action as Bookmark. So when the users click on that button, they will be directed to the relevant page of your report with the year filter selected as 2022.

     

    Works for you? Mark this post as a solution if it does!
    Check out this blog of mine: How to Export Telemetry Data from Azure IoT Central into Power BI 
     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    I created some data:

    Here are the steps you can follow:

    1. Get more visuals – Preselected Slicer.

    2. Enter data – Create a table.

    3. Create measure.

    Flag =
    var _year=SELECTEDVALUE('Table'[Year])
    var _default2022 = YEAR(TODAY())
    return
    IF(_year=_default2022 , TRUE(),FALSE())

    4. Place the fields in the Preselected Slicer as follows.

    5. Result:

    Automatic default 2022

     

    Best Regards,

    Liu Yang

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