Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
Say like 2 tables.
1 is fact with unique accounts and its transactions.
2 is accountid and email ids.
an account can be shared with multiple users, so table 2 will have many records.
For an instance,
Table 1:
Account ID
1
2
3
Table 2:
Accountid EmailId
Like this.
so now i want to fapply RLS based on user login.
If J login he should see his accounts, if B login he should see his accounts etc..
i tried few measures like this but not working.
Solved! Go to Solution.
Let the data model do the work. Link the tables, make sure the filter direction is pointing from accounts to transactions, and put the RLS on the accounts table with a simple formula:
[Emailid]=USERPRINCIPALNAME()
Hi @Anonymous ,
See if these help.
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi
https://radacad.com/show-the-information-but-not-the-details-power-bi-data-masking
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi Harsh, i tried thise radcad blogs, my scenario is not suited however as you see above measures with filter condition, i tried similar to those blogs.
Let the data model do the work. Link the tables, make sure the filter direction is pointing from accounts to transactions, and put the RLS on the accounts table with a simple formula:
[Emailid]=USERPRINCIPALNAME()
There is no emailid field in accounta table, that is soo simple RLS, that doesn't work here.
we need to virtually filter the accounts table data based on user login. User email and his accounts are in table 2.
kindly give me a solution.
@mwegener
here is my model.
and this is the error i am getting if i try to apply security in both directions.
Hi @Anonymous ,
doesn't it work without the checkbox?
@mwegener @harshnathani @lbendlin @sturlaws
thank you all for your time on this.
this might work for now.
now we have aroung 100 K records in account table.
each account might be shared with multiple users.
for instance, if one account is shared by 10 users it means 10 rows.
likewise if we have 100 records vs 10 users it will be 100 * 10.
future maintanance of the dataset will be nightmare, what should be solution to handle this ? at the same time need to use the same RLS functionality.
looking forward to hear from you.
Hi @Anonymous ,
you could group the users and accounts into profiles, like in this blog post.
https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi
@sturlaws
yeah this is what something i am expecting.
VAR _account_id = CALCULATETABLE ( VALUES ( 'table1'[account_d] ), FILTER ( 'table2','table2'[email] = USERPRINCIPALNAME () ) ) RETURN 'Table1'[account_id] IN _account_id
where whould i use this DAX to filter? in table 1(fact) or table2(user table) ?
Thank you Marcus, well in my scenario, i have already used apply security check box to another, so i cant use it here. Give me sometime, i will test again and i will post my data model picture.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
43 | |
19 | |
18 |