Forum Discussion

MattKav's avatar
MattKav
Icon for Advocate I rankAdvocate I
2 years ago

Default a filter to most-recent Month

I have a report page with a Tile filter down the side of Months, which works great for users to view data and insight relative to that month. Source data is updated automatically each month, therefore list of available months will increase over time.

 

What I'm after is for the user to open the page and, at any time, the most-recent month is selected.

 

I've read other related links but they seem to direct me towards solutions of:

- filtering the dataset to only the most recent month - this is no good as I still require users to choose a different month if they so desire.

- the developer opens the pbix file each month, set the filter to most recent month, save and republish - this is no good as I'm looking for a hands-off approach.

 

Does anyone have any ideas? Note also that most-recent month won't always be the current month. In a perfect world the filter visual would have a 'default value' attribute..!

 

...thanks in advance.

3 Replies

  • Hello MattKav , 

     

    Please use the below approches

     

    This measure will calculate the latest available month from your data

     

    LatestMonth =
    CALCULATE(
    MAX('DateTable'[Month]),
    ALL('DateTable') -- Ignores existing filters to get the true max month)

     

    Create Another Measure to Check If It’s the Latest Month

     

    IsLatestMonth =
    IF(MAX('DateTable'[Month]) = [LatestMonth],1,0)

     

    Add a Visual Level Filter to the Report Tile (Slicer)

    1. Add a Slicer or Tile visual for the Month field.

    2.Use the IsLatestMonth measure as a visual-level filter.

    3. Set the filter to "IsLatestMonth = 1". This ensures that when the report loads, the slicer shows the most recent month by default.

     

    If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!

     

    Thank You

    Dharmendar S

    LinkedIN 

  • Thanks dharmendars007 - so the user will see a filter with all months, with most recent selected, and still be able to select a different month? I haven't tried your suggestion but my concern is that step 3 will filter the Tiles to only that single month...?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reply from dharmendars007, please allow me to provide another insight.
      Hi MattKav ,

      There is no way to control the slicer to automatically select a specific value.
      You can only control which values the slicer displays by filtering.

      Therefore, you can take dharmendars007's suggestion and have the slicer only show the most recent month so that the user can select it.
      Then add an identical slicer (without applying any filters and without interfering with the slicer above) that lets the user select a month other than the most recent.

       

      Best Regards,
      Dengliang Li

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