Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
I have been following THIS article on how to setup row based security using passed through credentials.
I have two identical (duplicates) tables: Employee, and EmployeeSecurity that consist of the following columns:
I have a relationship setup between EmployeeSecurity.SupervisorID to Employee.ContactID.
I currently have a Role setup on the tabulear model that contains these to tables or dimensions with read access.
The Row Filter I am using could probably use some fixing but I'm not sure where:
=Employee[SupervisorID]=LOOKUPVALUE(EmployeeSecurity[SupervisorID],EmployeeSecurity[ActiveDirectoryUserName],USERNAME())
I am trying to make it so employees can see their supervisors, and/or supervisors can see their employees. I'm hoping someone sees either what is wrong with my DAX or maybe I'm going about settin up the relationship incorrectly.
This is just for functionality practice to prove Dynamic Row Based Security will work for us.
Hi @Anonymous,
According to above tutorial, your DAX filter formula should be:
=Employee[SupervisorID]=LOOKUPVALUE(EmployeeSecurity[SupervisorID],EmployeeSecurity[ActiveDirectoryUserName],USERNAME(), EmployeeSecurity[SupervisorID], Employee[SupervisorID])
Regards,
Yuliana Gu
Thanks for the response @v-yulgu-msft.
I'm wondering if the problem might be a few things together. Possibly the created relationship with filter direction and a poor understanding of the LOOKUPVALUE DAX.
With the changes you suggested the user received no data. I altered the DAX to:
=Employee[ContactID]=LOOKUPVALUE(EmployeeSecurity[ContactID],EmployeeSecurity[ActiveDirectoryUserName],USERNAME(), EmployeeSecurity[SupervisorID], Employee[SupervisorID])
And now the user sees SOME data but not his/her own records.
Does anyone have experiance with this, and if so do you have any documentation, examples I can look at?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |