Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
I am trying to set a slicer in Power BI to automatically default to the latest date in my dataset. I have a column called load_date in my table. I want the slicer to always show the most recent date without needing to manually select it each time.
Steps Taken:
Created a measure to identify the latest date:
LatestDate = CALCULATE(MAX('table'[load_date]))
Created a calculated column to flag the latest date:
IsLatestDate = IF('table'[load_date] = [LatestDate], "Latest", "Historical")
Added a slicer using the load_date field.
Issue:
The slicer does not automatically pick the latest date after a data refresh.
Both the latest date and the previous day's date show up in the slicer.
I have to manually select the latest date in Power BI Desktop for the data and visuals to refresh correctly.
Example:
After a refresh, the slicer shows both 03-02-2025 and the previous day's date.
The visuals on the dashboard do not sync and show 0 values until I manually select the latest date.
Request:
How can I configure the slicer to automatically select the latest date upon data refresh without manual intervention?
Please help
Solved! Go to Solution.
Hi @Tarun_B
Power BI retains a filter value based on the slicer selection. If you choose "Latest" instead of a specific date, the "Latest" option will continue to be selected when the dates change, unlike when you select the date itself.
Notice the difference when a category is selectead instead of a date:
For those willing to experiment, you can use the "Group by Columns" property to store a filter using an alternate value that represents the entity's key. Power BI uses this key to dynamically adjust the filter value in the visual. For example, if May-24 is selected and currently has a key of 0, when June arrives, May's key will shift to 1, and June will take the key of 0. As a result, the slicer selection will automatically update to June. This functionality can be achieved using an external tool called Tabular Editor. A demo and further reading are available in the video description. https://www.youtube.com/watch?v=MrEAZREQuXM&t=3s
Thanks for the reply from danextian , please allow me to add some more information:
Hi @Tarun_B ,
You can try using the “Preselected Slicer” in the custom viusal.
For the slicer that comes with Power BI, we can not get it. But we can get the three point in the "Visualizations", and we click the "Get more visual":
First , we need to create a table with one column , and the value is True and False, like this:
Second , we can create a measure to define which the date we need to default preselected. If we need to default preselect then we return True else return False.
Flag =
VAR _date =
SELECTEDVALUE ( 'Table'[Date] )
VAR _max_date =
MAXX ( ALL ( 'Table' ), [Date] )
RETURN
IF ( _date = _max_date, TRUE (), FALSE () )
Then we can put the 'Table'[Date] in the Fields , [Flag] in the Pre Selection , 'Dirty Table'[Dirty Status] in the Dirty Status, like below screenshot:
We can then dynamically pre-select the last day by default in the slice visualization, and when we select another date, simply click the red reset button in the upper right corner to restore the default selection.
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
Let me try this today at 8 PM IST, once the data refreshes I will keep you posted.
Hi @Tarun_B
Power BI retains a filter value based on the slicer selection. If you choose "Latest" instead of a specific date, the "Latest" option will continue to be selected when the dates change, unlike when you select the date itself.
Notice the difference when a category is selectead instead of a date:
For those willing to experiment, you can use the "Group by Columns" property to store a filter using an alternate value that represents the entity's key. Power BI uses this key to dynamically adjust the filter value in the visual. For example, if May-24 is selected and currently has a key of 0, when June arrives, May's key will shift to 1, and June will take the key of 0. As a result, the slicer selection will automatically update to June. This functionality can be achieved using an external tool called Tabular Editor. A demo and further reading are available in the video description. https://www.youtube.com/watch?v=MrEAZREQuXM&t=3s
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
91 | |
75 | |
65 | |
49 | |
36 |
User | Count |
---|---|
115 | |
89 | |
80 | |
59 | |
40 |