Forum Discussion
RLS/Dynamic Filter Help needed
- 2 years ago
You don't have the two table connected together do you? There is no need for a relationship between the two tables. That is the only thing I can think of that might cause the problem.
Gotcha, that makes more sense. I am going to assume you don't want users to see anything from the 'WMFSED Table', this is the table that holds their email and location / job_watch so there is nothing for them to look at anyway.
We apply a filter to the 'SA Table' like this.
VAR _UPN = USERPRINCIPALNAME()
VAR _Location = LOOKUPVALUE ( 'WMFSED Table'[JOB_LOCATION],'WMFSED Table'[WORK_EMAIL],_UPN)
VAR _JobWatch = LOOKUPVALUE ( 'WMFSED Table'[JOB_WATCH],'WMFSED Table'[WORK_EMAIL],_UPN)
RETURN
'SA Table'[location] = _Location &&
'SA Table'[job_watch] = _JobWatch
This reads the 'WMFSED Table'[JOB_LOCATION] and 'WMFSED Table'[JOB_WATCH] based on who is logged in and applies those as filters to teh 'SA Table'
We also apply a filter to the 'WMFSED Table' like this.
FALSE()
This just means that the role cannot see any data on this table.
Using the View as Andy.Jones we can see the filtering applied:
And this is what Pete.Green looks like:
I have attached my updated file for you to look at.
jdbuchanan71
I'm really sorry if this is being problematic but for obvious reasons were using test data but when applied to my live stuff it fails to work as expected.
As you can you to understand i can't show any live contact data so the email address, names etc need to be assumed 😞
And with the amount of records its difficult to show.
But i have applied your formula
The data return is only returning the logged in user detail whose email address I have used to test
So do I need to include the other columns in the expression? (all from the SA Table)
The other 'people' at the location and watch names are not showing 😞
regards Gary