Forum Discussion

Cupola24's avatar
Cupola24
New Member
1 year ago
Solved

Get latest day data when report is loaded

Hi All,   Need your help on this Issue which I am facing.I am using date range filter/slicer on my report,   The issue is when I publish my report, the filter always shows the date on which...
  • rajasaadk_98's avatar
    1 year ago

    Solution: Use a Dynamic Relative Date Slicer alongside a Static Range Slicer

    Since you want to stick to a range slicer, which retains the visual look (as shown in your image), we can set a workaround using dynamic filters or DAX measures to ensure the latest date is always selected initially.

    Steps:

    1. Create a Dynamic Date Measure:

      • First, create a measure that dynamically calculates the latest date in your dataset.
      • Go to Modeling and select New Measure. Use the following DAX formula:
      DAX
      Copy code
      LatestDate = MAX(YourDateTable[Date])

      This measure will return the most recent date in your data.

    2. Add a Filter Based on Latest Date:

      • In your report, you’ll keep your range slicer. To ensure the default shows the latest data, do the following:
        • Add a page-level filter using this new LatestDate measure, and set it to the latest date. This will filter the page to always show the latest date by default, while allowing the user to adjust the range on the slicer afterward.
    3. Optional: Using a Bookmark for Default View:

      • After setting the slicer to your desired default state (i.e., with the date range starting from the latest date), create a Bookmark:
        • Go to View > Bookmarks and create a new one.
        • Set the bookmark as the default view. When users reopen the report or refresh the page, it will reset to this bookmark, displaying the most recent date.
    4. Publish to Power BI Service:

      • Once published, whenever the data is refreshed daily, the report will default to showing the latest date range without affecting the slicer appearance.