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
Chriesel
New Member

RLS per user with active/inactive filter per report

Dear folks,


Dataset -> Report Structure:

I have one single dataset that gets all of our sales data from our erp.
From this dataset, I created several reports for different purposes.

Requirement:

  • One report, our sales team should have access to all data (not filtered by user).
    All of the other reports should just show his/her own sales data (filtered by user).
    • Background of the requirement is that the total sales should be viewed by everyone, but not the respective special prices and discounts of its customers.
  • Users that also have access to the reports but do not belong to the sales team should have access to all data.

Ideas and attempts so far:

My intention is to activate or deactivate the filter per report:

  • New Table "UserFilter" with two values: Active, Inactive and set this column Check as report-level filter on filter pane. 
    • Set this filter to active
  • New User-Table with MailAddresses and his/her code that relates to its respective customer.
  • Set relationship between User and Customer-Table.
  • Add Role "Sales" in RLS and add the following code: 

 

 

IF(
	SELECTEDVALUE(UserFilter[Check])="Active",
	[Mail] = USERPRINCIPALNAME(),
	1=1
)

 

 

Problem:

  • The RLS ignores the set filter in the report.

I understand why that happens bcs the RLS is made for datasets and I filter on report level but copying my dataset is not an option only for one report in which the data should not be filtered by user. I don't even want to start with that, because otherwise I have to maintain 2 identical datasets.

 

Do you have an idea which help me solving the requirement?

Thank you in advance.

1 ACCEPTED SOLUTION

Hi @Chriesel ,

 

I think you need to duplicate the fact data within the dataset.
Once with RLS and once without RLS.

In the attached video Rick de Groot shows a similar use case for Benchmarking with Row Level Security.

https://www.youtube.com/watch?v=mci8Whd5Oeo

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


View solution in original post

1 REPLY 1

Hi @Chriesel ,

 

I think you need to duplicate the fact data within the dataset.
Once with RLS and once without RLS.

In the attached video Rick de Groot shows a similar use case for Benchmarking with Row Level Security.

https://www.youtube.com/watch?v=mci8Whd5Oeo

 

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast


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.