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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
AnthonyJoseph
Resolver III
Resolver III

Pre-selected slicer to select based on the max year value

I have a table with the clients and their years of scope  are fields. Using RLS we are showing data based on the logged in client, request here is to have the maximum of the year  selected by default based on the logged in client.

 

For example:

 

when client A logsin the pre-selected slicer should have selected value 2022. When client B logsin slicer should have selected 2021 by default. When client C logsin slicer should have selected 2022 by default.

 

Client NameYear
A2020
A2021
A2022
B2020
B2021
C2019
C2020
C2021
C2022

 

is there any way to achieve this?

 

Thanks,

AnthonyJoseph

5 REPLIES 5
pratyashasamal
Memorable Member
Memorable Member

Hi  ,Here are the steps you can follow:

1. Create calculated column.

Column =
var _max=MAXX(ALL('Calendar table'),'Calendar table'[Date])
return
IF(
    'Calendar table'[Date]=_max,"Maxdate",FORMAT('Calendar table'[Date],"yyyy/mm/dd"))

2. Place [Column] in the slicer and set Sort descending.

 

3. Result:

Will change the maximum date to "Maxdate" and stay at the top of the slicer:

 

As you have RLS the dates will be automatically restricted for each user.
Thanks ,
Pratyasha Samal

 

 

pratyashasamal_1-1699257093462.png

pratyashasamal_0-1699257093460.jpeg

@AnthonyJoseph





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks @pratyashasamal . We are currently using this approach but the ask here is more specific to the "preselected slicer" visual. i.e. not to have generic terms (like max date/today/this month) in the slicer..

Hi @AnthonyJoseph  , 
You can also try this :-

According to your description, you want to "set default values dynamically for slicer".

Here are teh steps you can refer to :
(1)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":

pratyashasamal_0-1699272548238.jpeg

 

Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.

pratyashasamal_1-1699272548031.jpeg

 

 

Thanks ,
Pratyasha Samal





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks @pratyashasamal yes, I was referring to this visual(have been trying to cack this) but I was not able to achieve the desired output...

Hi @AnthonyJoseph ,
I dont think there any other approach for this particular use case.
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors