The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
I came across "Security Filtering Behaviour = None" in Tabular Editor (both 2 and 3) and initially got excited that it would allow me to solve a specifc use case with RLS in order to leave all data available but just hide rows in one dimension table. (Specifically names). Suspect it may just not be supported (yet?) but wondered if anyone knew anything about what it is supposed to do.
I built this demo file
Connected to it with tabular editor (works in both the free version and version 3) and set the compatibility level to 1566 as it told me the property wasn't supported with levels below 1561.
Then on the relationship between the person table and the results fact table I set Security Filtering Behaviour to None
I was hoping it would filter that table but not pass anything to any other table.
Surprisingly it let me save back to Power Bi Desktop (had thought this would only get anywhere within XLMA connection to service).
WIthout RLS active it shows:
Note the 12 test results when nothing is filtered.
Now the odd bit! It didn't work but almost did...
Turning on one of the RLS rules gives:
Nothing shows however the number of results still shows as 12. In table view nothing is visible (before someone asks I turned off visual interaction).
Thoughts welcome.
So I've made it do what I wanted by setting the relationship between Person and Results as Many Many Cardinality with Person filtering results. (That reset the Security Filter = None so had to put it back). Everything now works as I wanted. Would love to know why though! Might be something to do with the Many Many relaitonship breaking table expansion? @AlexisOlson, @marcorusso, @smpa01, @parry2k any ideas?
Updated version with this in place here
Correct. Limited relationships are not used in table expansion.
This is mentioned in both of these articles:
https://www.sqlbi.com/articles/strong-and-weak-relationships-in-power-bi/
https://www.sqlbi.com/articles/relationships-in-power-bi-and-tabular-models/
Thanks Alexis, thought that was the case.
What I'm trying to understand is the behaviour of the "Security Filtering Behaviour = None" and how/why it's behaviour changes with a limited relationship.
I went back and watched some videos from SQLBI's Mastering Tabular. As a result I wondered if actually the setting only kicked in with a bidirectional relationship. Have a look at:
One to One Example
Relationships are setup as:
and the security filtering behaviour between Person and Demographic is set to none.
Connecting to the model with DAX studio as Group 1:
Then running the following:
EVALUATE
Results
EVALUATE
{ COUNTROWS ( Results ) }
gives:
(6 rows)
vs
Even thinking in terms of expanded table I can't come up with anything close to even a loose explanation of this.
How does this work as an explanation. Might be miles off so please shoot it down but works in my head.
When Filtering Behaviour is set to None in the latest example the rows in Person table don't go into the filter context and so COUNTROWS returns 12. However when EVALUATE returns 'Results' it returns only rows present in the expanded table.
If filtering behaviour is left as default (Single) then rows from Person go into filter context and so COUNTROWS and EVALUATE match.
If the relationship is many to many the relationship is limited and so expanded table plays no part.
No, talking to myself but that logic breaks down when other predicates like Test[Test Name] = "Test 1" are thrown into the filter context. Going to ponder on it further.