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.
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?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
64 | |
63 |
User | Count |
---|---|
141 | |
105 | |
101 | |
80 | |
67 |