Forum Discussion
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 I published the report, whereas what I want is that whenever the report is loaded, re-opened or refreshed it always shows me the latest day data (later if the user wants he can go back to previous dates to fetch results but by default it should show latest date data.
The report is created on data which is fetched via import mode, also the data on the report is refreshed daily on the power bi service early monring.
I tried creating a dax and using it into the filters pane for the latest data but it messes up everything and doesn't support our purppose.
Please guide and suggest what can we do, We don't want to swtich the filter to selection, dropdown etc. we want it to be range only.
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:
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:
DAXCopy codeLatestDate = MAX(YourDateTable[Date])This measure will return the most recent date in your data.
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.
- In your report, you’ll keep your range slicer. To ensure the default shows the latest data, do the following:
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.
- After setting the slicer to your desired default state (i.e., with the date range starting from the latest date), create a Bookmark:
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.
5 Replies
- rajasaadk_98Helper I
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:
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:
DAXCopy codeLatestDate = MAX(YourDateTable[Date])This measure will return the most recent date in your data.
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.
- In your report, you’ll keep your range slicer. To ensure the default shows the latest data, do the following:
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.
- After setting the slicer to your desired default state (i.e., with the date range starting from the latest date), create a Bookmark:
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.
- lbendlinSuper User
I am using date range filter/slicer on my report,There's your issue - right there.
Use the filter pane instead, with relative date filtering.
- Cupola24New Member
Hi Ibendin, currently we are using the slicer only with relative date range selection.
Kindly suggest a way in which the slicer is always set to the current date when the report is loaded, later if the user wants he can filter on last dates from the slicer.
We don't want to give user access to filter pane we have set it to not-readible. We want to handle this on the report only.
- lbendlinSuper User
We don't want to give user access to filter pane we have set it to not-readible. We want to handle this on the report only.I cannot assist you if you are preventing your users from using Power BI as it is intended. I hope someone else can help you further.