Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help with auto selecting latest date in date slicer

Hi Forums,

I have been struggling with the below scenario in my report. Hope I can get some help.

- I have a slicer and am placing a date column that filters my page level reports. Now I have a date value(1/1/1970) which basically is a flag that holds my historical data. I would not be showing this flag date in the slicer visually to the user however the charts will hold data corresponding to the flag date(1/1/19970).

To achieve this I am doing a "Select all" in my slicer and at the same time un-selecting "1/1/1970" from the filter pane which does hide the flag date from my slicer(still selected in the background). I will further undo select all from the Selection control and manually un-select all other dates. So whenever I open my report I will see the data of the historical date since its selected in the background. I will then select the latest date from the slicer that I would like to see the data in my reports. Please see the screencast here - https://www.screencast.com/t/3Y7ogX7pebz

Issue:

My issue now is when I refresh my data I want only the latest date only to be selected below (Latest available date) but since I do a select all (to hide my historical date) Power BI selects all the successive dates from my previous versions selected date which was 2/16/2020(screenshot attached below). I want power BI to default the selection to the Latest date only.

I even tried Hierarchy slicer but it doesn't work.

version.png

Would be greatly helpful if I get a solution for the above. Thanks very much.

Slicer Filter slicers @amitchandak @v-xuding-msft @V-pazhen-msft @MFelix 

5 REPLIES 5
v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

It couldn't achieve that set a default value for a slicer, becasue when you log out of Power BI and come back to a report, the same items will be selected as when you left.

here is the idea, please see detailed explanation in it:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/7162004-default-selected-slicer-or-tile-by-value-configura

 

And for those who’re looking to have a ‘latest date in date slicer’ selection, the relative date slicer might help.

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-lili6-msft 

I think the post that you referenced helps but my worry here is to hide a slicer value from the visual perspective while still having the value selected and I can't do this without doing a "Select all"& hiding it in the filters pane. If I go with this workaround I run into another issue where multiple selections are made when my data is refreshed as new values are loaded to my slicer. Do you know of any other way to hide a slicer value from a slicer with that value being selected? 

Here is the screencast - https://www.screencast.com/t/3Y7ogX7pebz

 

glissando
Resolver II
Resolver II

I'm not sure I fully understand your request but have you tried using Top N in the visual slicer? Use your data table date column in the By Value field with Latest Date selected. Let me know if that worked. Thanks

Please let me know if the attached solution is what you are looking for.

Add a column to your fact table using the code below and use it in your slicer.

 

Latest Date =
IF('Fact Table'[Date] = MAX([Date]),
"Latest",
FORMAT('Fact Table'[Date],"mm/d/yyyy"))
 

Hopefully, the image is clear.

Thanks

 

Latest Date Only.jpg

 

Thanks

Anonymous
Not applicable

Hi @glissando, this doesn't help my request. I've already pulled my max date using the same formula. Thanks. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.