This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Need a help on creating a DAX measure to add in Role condition under Manage Roles.
I have a table called "Employee_Master" where there are below columns. The IsManager/Supervisor? column indicates if an employee is a manager or supervisor.
I need to now filter the data in RLS based on this condition.
The condition is "if an employee is a manager, then give access to his directs and himself. if not give access only to his record.
Kindly help me with the dax expression for RLS.
For example : if 1005 logs in, he should see himself (1005) and his subordinates 1003 & 1010
| employee id | Employee name | Manager ID | Supervisor ID | IsManager/Supervisor? |
| 1001 | raghu | 1 | ||
| 1002 | rathna | 1001 | 1003 | 1 |
| 1003 | suresh | 1001 | 1005 | 1 |
| 1004 | manju | 1002 | 1003 | 0 |
| 1005 | simha | 1002 | 1003 | 1 |
| 1006 | sam | 1002 | 1003 | 1 |
| 1007 | dan | 1001 | 1006 | 0 |
| 1008 | charan | 1001 | 1006 | 0 |
| 1009 | vijay | 1001 | 1006 | 0 |
| 1010 | sunil | 1005 | 1003 | 0 |
Solved! Go to Solution.
Try
FORMAT('Table'[Manager ID],"#") = USERPRINCIPALNAME()
||
FORMAT('Table'[Supervisor ID],"#") = USERPRINCIPALNAME()
||
FORMAT('Table'[employee id],"#") = USERPRINCIPALNAME()Note that the format function should not be required it was used for testing as the UPN was a number. Also suggest that you include an email field on your table so that you can use USERPRINCIPALNAME()
Good luck
@jsaunders_zero9 thank you very much. I did the similar solution in my actual file.
Try
FORMAT('Table'[Manager ID],"#") = USERPRINCIPALNAME()
||
FORMAT('Table'[Supervisor ID],"#") = USERPRINCIPALNAME()
||
FORMAT('Table'[employee id],"#") = USERPRINCIPALNAME()Note that the format function should not be required it was used for testing as the UPN was a number. Also suggest that you include an email field on your table so that you can use USERPRINCIPALNAME()
Good luck
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 23 | |
| 23 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 63 | |
| 38 | |
| 25 | |
| 23 | |
| 22 |