Forum Discussion
Can we test a measure's value in our RLS?
I'm sorry; I'm not sure I understand your questions.
The measure I'm testing is Report_Access.
This report has five tables, but the visual I'm looking at is using one of the tables. We have the security on that table as
MyMeasures [Report_Access] = True
Report_Access is not a column in the data table.
I don't think I've answered your questions, have I?
I'm not familiar with setting up default roles.
So you have set up something like this:
If you measure evaluates to true/false, it is not necessary to write measure=true.
Now, from the picture above, there is only filter on 'Table', not on 'Table 2'. If there is a relationship between the two tables, the RLS filter on 'Table' might propagate to 'Table 2'(depending on how the relationship is set up). If there is no relationship between the two tables, you will have to manually set something that filters on 'Table 2'.
Once that is sorted out, you also have to add members to the role if you want them to see any data.
- Anonymous6 years agoNot applicable
I was trying to simplify the example, but let me describe the full issue with screenshots.
I have the table Practice data, and I'm testing to see if Report_access is True (which should determine if anything can be seen or if the whole report is empty) and then also filtering the data that the user can see by location and by organization. The visual I'm viewing only has data from the Practice data table.
The Security table RLS is: [user email] = Userprincipalname()
Report access is defined:
Report_access = contains ('Security', [Report name],[This_report])
This_report is set to the name of this report.
So the first part of the RLS test on the data table is testing to see if this user even has access to this report.
Here are the values in my two tables.
These next slides are what I captured and documented back in March. Depending upon the report name, the entries in the Report Data would change appropriately. But today, I've opened the same PBIX file that I saved back in March. And no matter what I set the report name value, the data table report displays all of the entries. And even if I use View as Roles and use an imaginary userid that isn't in the security table, I'm still able to see all of the entries in the data table. It's as if the RLS filter isn't there.
Does the explanation make sense? IIf necessary, it's a small practice file that I ran the original tests on, and I could zip it if we have a way to share files.
Chuck
- Anonymous6 years agoNot applicable
It appears to me that a change has been made to Power BI that has stopped this from working. What I'm wondering ... is this a permanent change, or is it a bug that I can expect to be fixed?
- sturlaws6 years ago
Resident Rockstar
Hi Anonymous
sorry for the delayed response, I were not able to get any work done during summer vacation.
If you have a file you can share, you can upload it to dropbox/onedrive/other, and share the link, either here in the forum or send it to me in a private messageCheers,
Sturla