Forum Discussion

nataliesmiy1357's avatar
1 year ago
Solved

Default Filters on pages

Hello!  How do I do a default filter on each page?  I am looking to show ONLY the last 12 calendar months when you click on the page, but then you are ALSO able to use the slicers to show previous data.

 

Sooo as of right now:  Show past 12 months

but also show 2021, 2022, 2023, ect data.

 

Thanks in advance, 

  • Hi nataliesmiy1357 ,

     

    I understood your requirement, unfortunately that is not availbale out of the box. 

     

    To achieve the same behaviou you can do a little workaround.

     

    1 - Create two pages

    2 - give a toggel button

    3- first page you put page level filter 

    4- second page you give slicer to user

    5 - the toggle button will help user to see by default 12 months data and choice of selecting the other months and year date.

     

    hope this will help you. please let me know if you have any other queries 

     

    Thanks,

     

3 Replies

  • Hi nataliesmiy1357 - create a calculated column in your date table as below:

     

    Last12MonthsFlag =
    IF(
        'Date'[Date] >= EDATE(TODAY(), -12) && 'Date'[Date] <= TODAY(),
        1,
        0
    )
     

     

    apply each report page where you want this filter to be applied.
    In the Filters pane on the right, drag the IsLast12Months measure to the Page-level filters section.
    Set the filter to IsLast12Months = 1. This will filter the visuals on that page to show only the last 12 months by default.

     

    Hope this helps.

     


     

  • nataliesmiy1357 

    Create a measure:

    Last12MonthsVolume = 
    CALCULATE(
    SUM('YourDataTable'[YourValueColumn]),
    DATESINPERIOD(DateTable[Date], MAX(DateTable[Date]), -12, MONTH)
    )
    1. In the Page level filters section, drag the Date field from the DateTable.
      Set the filter condition:
      Choose "is in the last" and set it to 12 months. This will apply a filter to show only the last 12 months by default when the page is opened.
    2. To allow users to select different years or specific dates, add slicers to your report:
      Drag the Year field from your DateTable into the slicer visual.

    💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
    Cheers,
    Kedar
    Connect on LinkedIn

  • Hi nataliesmiy1357 ,

     

    I understood your requirement, unfortunately that is not availbale out of the box. 

     

    To achieve the same behaviou you can do a little workaround.

     

    1 - Create two pages

    2 - give a toggel button

    3- first page you put page level filter 

    4- second page you give slicer to user

    5 - the toggle button will help user to see by default 12 months data and choice of selecting the other months and year date.

     

    hope this will help you. please let me know if you have any other queries 

     

    Thanks,