Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
PowerBI001
Frequent Visitor

Using RLS with Dynamics CRM Online

Has anyone managed to achieve this using USERNAME() and RLS (Row Level Security).
I've been trying for a number of hours now and it just doesn't seem to work.

1 ACCEPTED SOLUTION

Hi @PowerBI001 ,

 

RLS wouldn't work on the owner of the dataset. Because the owner can edit both the dataset and reports. RLS aims at controlling the data access rather than something like filtering. You can run "Test as role" to see the effect.

According to my test, RLS works as expected. 

 Using RLS with Dynamics CRM Online 2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Classboat
New Member

Did you notice that it would work if you share the report with others? Maybe you are the owner of the dataset. But I will find out more details tomorrow. I have tested it. You can test it with sharing with colleagues.


Regards,
Classboat

PowerBI001
Frequent Visitor

This is exactly what I've done.  

 

Created a dataset with 2 records in Power BI desktop directly:

b1001.png

 

 

 

 

This is the DAX statement I’ve got setup

b1002.png

 

And configured Security for the dataset, add me and another user

bi003.png

 

But when I view the data in www.app.powerbi.com I see both records.  I should see the 1 record corresponding to my email address.

 

If I test using ‘Test as role’ it works as I expect and shows just my record.

bi004.png

bi005.png

 

 

 

Hi @PowerBI001,

 

Did you notice that it would work if you share the report with others? Maybe you are the owner of the dataset. But I will find out more details tomorrow. I have tested it. You can test it with sharing with colleagues.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, @v-jiascu-msft,

 

I have no other users to share it with currently, I'm trialling whether this works, and then I will buy a subscription.

 

Could you test whether the owner of the dataset is unable to view the data with RLS applied?

 

Thanks

Hi @PowerBI001 ,

 

RLS wouldn't work on the owner of the dataset. Because the owner can edit both the dataset and reports. RLS aims at controlling the data access rather than something like filtering. You can run "Test as role" to see the effect.

According to my test, RLS works as expected. 

 Using RLS with Dynamics CRM Online 2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

 

 

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-jiascu-msft.  I can confirm this is the case with my testing also. 🙂

v-jiascu-msft
Employee
Employee

Hi @PowerBI001,

 

Did you get any error messages? Could you please post some snapshots?

I did it following the steps below. It worked.

1. Create reports and RLS roles in the Desktop. (RLS roles only can be created in the Desktop)

 

if(userprincipalname()="xxxx@xxx.com",[id] = "A")

Using RLS with Dynamics CRM Online .jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2. Publish the report to the Service.

3. Click the ellipses, Security, assign the role to users. Or test the role.

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
chethan
Resolver III
Resolver III

@PowerBI001

 

Use RLS is easy 

 

Identify the Row to filter based on the data 

 

[EmpID] = "Value" && [EmpID] = "Value"
[EmpID] = "123" && [EmpName] = "ABC"

 

& Cross check in View as Roles.

 

Upload the file in service & assign the User or Group

 

 

Regards,

Chetan K

https://www.urbanpro.com/chetank

PowerBI001
Frequent Visitor

Has anyone managed to achieve this using USERNAME() and RLS (Row Level Security).

I've been trying for a number of hours now and it just doesn't seem to work.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.