Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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 Name | Year |
A | 2020 |
A | 2021 |
A | 2022 |
B | 2020 |
B | 2021 |
C | 2019 |
C | 2020 |
C | 2021 |
C | 2022 |
is there any way to achieve this?
Thanks,
AnthonyJoseph
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
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":
Then we find the "Preselected Slicer" and add the visual to our Power Bi Desktop.
Thanks ,
Pratyasha Samal
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
Proud to be a Super User!