Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello,
I have the following model for a report:
I've been asked to implement RLS and I'm having some trouble figuring out the correct method.
In my original model table 1 does not exist and is not required. Table 1 is added for RLS amd contains a list of users email addresses, and the IDs which represent the rows I want the fact table, table 2, to filter to. One ID can be accessed my multiple users in table 1 which is why it is a many>many relationship. The RLS is setup to use Userprinciple name to filter table 1 and subsequently table 2. This element seems to work fine, as I can see when RLS is applied, table 2 does filter to the correct IDs the person in table 1 has access to. Due to table 2 being the fact table and on the many of the many>one side, it does not pass these filters through to the associated dimension tables.
I have been reading into this as it is new to me, and thought I could use crossfilter within my measures to make the filters flow through to the dimension tables. As an example, for a measure that counts the rows in table 3 I thought I could try something like the below to count the total rows in table 3, but only for the rows which match those filtered in table 2:
CountRowsTable3 = CALCULATE(
COUNTROWS(Table3),
CROSSFILTER('Table2'[ColumnA],Table3[ColumnA],Both)
When I do this calc I still get the total number of rows in table 3 without the RLS applied.
Grateful for any steers on the best way to do this, or if I am down totally the wrong track happy to be told so too!
Thank you
Hi @Scocal123,
I'd like to suggest you check the relationship direction to confirm these filter effect can correctly apply through these table relationship mappings.(single direction relationship only work on one side, you may need to modify some of them to both direction)
What is the Direction of Relationship in Power BI? - RADACAD
Regards.
Xiaoxin SHeng
Thank you for the response.
I have tried your suggestion. In the example above, when I use 'View as role' to check the RLS, I can see that table 1 filters to 2 rows with 2 IDs which is correct. These 2 IDs from table 1 succesfsully filter table 2. I have set the relationship direction to 'both' between table 2 and 3, but it does not perform any filters on table 3 and I am struggling to understand why. Any advice would be appreciated.
Kind Regards
HI @Scocal123,
It sounds strange, I'd like to suggest you extract these three table to a standalone report to exclude other filter effects and try again.
Regards,
Xiaoxin Sheng
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
12 | |
11 | |
8 |
User | Count |
---|---|
24 | |
19 | |
12 | |
11 | |
10 |