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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
mmanwaring
Resolver I
Resolver I

RLS - creating a measure to overide RLS

Hi All

 

I have added RLS to a test dashboard.

 

My aim is to create a dashboard and share with a number of users. Each user will have data restriced to their sales only!

 

i have been asked as part of the dashboard that the user viewing the dashboard sees a KPI against the top sales person.

"User sales versus top sales person"

 

I created a calculate measure to clear the filter using ALL but RLS ignored this.

 

Can anyone help with a solution in this regard?

 

many thanks

Mike

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@mmanwaring

As per the online document Row-level security, the RLS filter the dataset directly. So I don't think your approach would ok.

In your case, to see a KPI against the top sales person in the condition that each user only has data restriced to their sales only, I think you can use a custom column storing the top sales.

TotalSalesForEachSaler = CALCULATE(SUM(Listings[sales]),FILTER(Listings,Listings[salerid]=EARLIER(Listings[salerid])))

TopSales = MAXX(Listings,Listings[TotalSalesForEachSaler])

Capture.PNGCapture1.PNG

 

If you have any question, feel free to let me know.

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

this is not solved yet!

Ermin
Advocate II
Advocate II

Hi @mmanwaring,

 

I have a similar issue with my multitenant Power BI dashboard.

 

Here is the link to my question:

http://community.powerbi.com/t5/Desktop/Power-BI-Embedded-and-multitenant-support/m-p/97576#M41109

 

There are also various answers on how to handle this topics. However, it looks like there is no standard solution to these kind of problems. 

Microsoft would need to catch up here because the whole effect of comparing my KPIs to the other is missing within RLS. 

 

In case you find a solution for this please keep me in the loop.

Eric_Zhang
Employee
Employee

@mmanwaring

As per the online document Row-level security, the RLS filter the dataset directly. So I don't think your approach would ok.

In your case, to see a KPI against the top sales person in the condition that each user only has data restriced to their sales only, I think you can use a custom column storing the top sales.

TotalSalesForEachSaler = CALCULATE(SUM(Listings[sales]),FILTER(Listings,Listings[salerid]=EARLIER(Listings[salerid])))

TopSales = MAXX(Listings,Listings[TotalSalesForEachSaler])

Capture.PNGCapture1.PNG

 

If you have any question, feel free to let me know.

Hello Eric,

 

The solution you have shared will work for sure. But my concern is, what if the user applies filters to the report.

For e.g. if the user filters the data by Geography, or say Date Range, etc., this is very much possible that the TOP performer for the filtered geography or the selected date range might change but if we calcualte it from backend/precalcualte the rank, it will remain constant.

 

Hence, please guide how to handle this situation.

 

Thanks,

Vinay

Thank you Eric

worked a treat.

 

Regards

Mike

ashishrj
Power Participant
Power Participant

Hi @mmanwaring Refer video here for RLS. Hope this helps !

Hi Ashishrj

thank you for the link.

i could not see anything within the video which describes RLS security as part of my powerbi.com dashboard which leads to a solution i am looking for.

Regards

Mike

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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