Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello,
The slicer has 2 values "Me" and "All users in my branch". If "Me" is selected, filter the table where the "CreatedBy" column has my username else display all. My data source is SQL server and the username is calculated from the table. Measure created for username is:
I'm having trouble as UserprincipalName func cannot be used in calculated columns. And measure cannot be added as field to the slicer. And I'm quite not sure if RLS can be used based on "Me" slicer value selection
your assistance is much appreciated
Solved! Go to Solution.
Hi @HariniParthiban ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _select=
SELECTEDVALUE('Slicer Table'[Slicer])
return
SWITCH(
TRUE(),
_select="Me"&&MAX('ACCESS_FW'[EMAIL_FW])=USERPRINCIPALNAME(),1,
ISFILTERED('Slicer Table'[Slicer])&&_select<>"Me",1,0
)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
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
Hi @HariniParthiban ,
Here are the steps you can follow:
1. Create measure.
Flag =
var _select=
SELECTEDVALUE('Slicer Table'[Slicer])
return
SWITCH(
TRUE(),
_select="Me"&&MAX('ACCESS_FW'[EMAIL_FW])=USERPRINCIPALNAME(),1,
ISFILTERED('Slicer Table'[Slicer])&&_select<>"Me",1,0
)
2. Place [Flag]in Filters, set is=1, apply filter.
3. Result:
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
Thank you very much for the detailed explanation. That worked!
Also, Is it possible to set default value to the slicer based on User login. I have a measure with values "User" and "Manager" depicting the role of the logged in person. When a Manager opens the report the slicer should select "All users in my branch" and when a regular user logs in, the slicer should be selected to "Me". They can change the selection if they want to.
Though I used bookmarks, it defaults to selection made when I published the report. Can you please help me with that?
User | Count |
---|---|
102 | |
92 | |
85 | |
78 | |
71 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |