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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
IzakVA
Regular Visitor

PBI Row Level Security and State-wide view

My app shows the state-wide data if a Ministry of Health (MOH) user is logged in and only the relevant Local Health District's (LHD) data if an LHD user is logged in. See the screen shots below.

MOH user: IzakVA_0-1732058610185.png

CCLHD user: IzakVA_1-1732058781863.png

 

Is it possible to let the CCLHD user see the state-wide view and then only allow the user to filter on their own LHD (CCLHD in this example). We want to allow the LHD user to view the state-wide view or the data for their own LHD, but not the data for any other LHD.

6 REPLIES 6
Anonymous
Not applicable

Hi @IzakVA ,

 

According to your description, here are my steps you can follow as a solution.

(1) We need to prepare a list of districts, which includes all districts.

vtangjiemsft_0-1732086159598.png

User table:

vtangjiemsft_1-1732086181705.png

Table: 

vtangjiemsft_2-1732086200627.png

vtangjiemsft_3-1732086217995.png

(2) New role.

vtangjiemsft_4-1732086283016.png

var a=USERPRINCIPALNAME()
var b=LOOKUPVALUE(user[user type],user[user email],a)
var c=LOOKUPVALUE(user[District],user[user email],a)
var d=VALUES(user[District])
RETURN IF(b<>"MOH",[District]=c,[District] in d)

(3) Then the result is as follows.

vtangjiemsft_5-1732086330694.png

 

vtangjiemsft_6-1732086353210.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi Neeko @Anonymous 

I have the list of districts in the LHD table. The LHD Name slicer is linked to this table. 

IzakVA_0-1732154179608.png

 

We don't reference a user directly in the RLS, since the list of users keeps on changing. I have a Role for each LHD which filters the LHD table for the relevant LHD.

IzakVA_1-1732154535945.png

 

Each Role is linked to a corresponding Active Directory group that contains all the users for that LHD.

IzakVA_2-1732154884515.png

 

Anonymous
Not applicable

Hi @IzakVA ,

 

It sounds like you have solved the problem yourself. Do you mean you want LHD users to view the statewide view? Then you could create a table with just one column of statewide regions and then create a table visual object. Note that this table has no model relationship to any other table and does not have any RLS set up. you should only see the CCLHD slicer and the statewide area reference table when you select it for the CCLHD role.
If I have misunderstood you, please clarify in a follow-up reply.

 

Best Regards,

Neeko Tang

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

Hi Neeko @Anonymous 

Yes, I would like to have the LHD user view the state-wide data view and have only the Relevant LHD name available in the LHD slicer as a filter option. If the LHD is selected, only the LHD's data should be displayed. If unselected, the state-wide data should be displayed. Is this possible?

IzakVA_0-1732582665097.png

IzakVA_1-1732582837368.png

 

Anonymous
Not applicable

Hi @IzakVA ,

 

We need to prepare a separate table of state-wide data. There is no model relationship between this table and other tables.

vtangjiemsft_0-1732585709035.png

 

Places the District column of the state-wide table on the table visual object.

vtangjiemsft_1-1732585882434.png

New roles.

vtangjiemsft_2-1732585919911.png

vtangjiemsft_3-1732585932985.png

vtangjiemsft_4-1732585945258.png

View as:

vtangjiemsft_5-1732585985954.png

vtangjiemsft_6-1732586001777.png

If anything is unclear to you, please refer to my pbix file.

 

Best Regards,

Neeko Tang

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

Thanks for your quick reply. I don't think this will work for me, since I have a data model with many tables and 21 report pages with visuals that all need to work off the slicers. I can't duplicate the whole data model. Thanks for the suggestion.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors