Forum Discussion

Chriesel's avatar
Chriesel
New Member
5 years ago
Solved

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 Reply