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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
CBO2404
Helper II
Helper II

how should I protect data when RLS is not an option?

I have two tables, one for comments in a report (Fact_reports) and one for access permission (Fact_access).

A report can always be viewed, except when a select number of users are listed in the access table.

CBO2404_0-1740667438128.png

 

 

For example, report id 1 is not in the Fact_access table, so everyone can view the information. However, report id 2 is in the Fact_access table and can only be viewed by users in the access table. I cannot use RLS because not all report rules are in the Fact_access table. How can I display (or count) in a Power BI visual only the comments that I have access to? 
As user 1 or user2 I can see both comments but user3 may only see comments of id 1.
This is a simple example of my problem. Hope the question is clear.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @CBO2404 ,

I think you can do these steps below:

 

1. Create a relationship between the Fact_Reports and Fact_Access tables based on the reportid column.

 

2. You can create two measures.

HasAccess = 
VAR CurrentUser = USERPRINCIPALNAME()
VAR ReportID = SELECTEDVALUE(Fact_Reports[reportid])
RETURN
IF(
    ISBLANK(LOOKUPVALUE(Fact_Access[userprinciple], Fact_Access[reportid], ReportID, Fact_Access[userprinciple], CurrentUser)),
    TRUE(),
    FALSE()
)
VisibleComments = 
IF(
    [HasAccess],
    COUNTROWS(Fact_Reports),
    BLANK()
)

 

3. Use the measure in your visual to filter the comments. You can add the VisibleComments measure to your visual to ensure that only the comments the user has access to are displayed.

 

 

Best Regards

Yilong Zhou

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

1 REPLY 1
Anonymous
Not applicable

Hi @CBO2404 ,

I think you can do these steps below:

 

1. Create a relationship between the Fact_Reports and Fact_Access tables based on the reportid column.

 

2. You can create two measures.

HasAccess = 
VAR CurrentUser = USERPRINCIPALNAME()
VAR ReportID = SELECTEDVALUE(Fact_Reports[reportid])
RETURN
IF(
    ISBLANK(LOOKUPVALUE(Fact_Access[userprinciple], Fact_Access[reportid], ReportID, Fact_Access[userprinciple], CurrentUser)),
    TRUE(),
    FALSE()
)
VisibleComments = 
IF(
    [HasAccess],
    COUNTROWS(Fact_Reports),
    BLANK()
)

 

3. Use the measure in your visual to filter the comments. You can add the VisibleComments measure to your visual to ensure that only the comments the user has access to are displayed.

 

 

Best Regards

Yilong Zhou

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors