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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jaryszek
Impactful Individual
Impactful Individual

Create RLS relationship for 2 columns in fact table

Hi Guys,

in fact table I have Cost data and want to restrict them based on BillingProfileId and BillingAccountId.

I created Permission Table with User, Email, BillingAccountId, BillingProfileId and trying to connect them to fact tables:

jaryszek_0-1738943865371.png

 

There is the issue that one relationship is inactive.
How to solve it? What is the best practice?

Create 2 roles for both BillingAccount and BillingProfile? 
1 User can have multiple Billing Accounts and Billing Profiles like you can see in my PermissionTable (many to many). 

Please help,
Best,
Jacek

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @jaryszek 

 

Yes. Creating a new composite primary key like BillingAccount-BillingProfile can be a good practice to handle many-to-many relationships in Power BI. This approach helps in uniquely identifying each record and can simplify the relationships between tables.

 

For Row-Level Security (RLS) filters, it's generally more efficient to enforce them on dimension tables rather than fact tables. In your case, you should create the RLS filters on the PermissionTable and ensure that these filters propagate through the relationships to the Bridge Table and then to the Fact Table1.

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
rajendraongole1
Super User
Super User

Hi @jaryszek  -You're encountering an issue where one of the relationships between your PermissionTable and Fact Table is inactive. Since one user can have multiple BillingAccountId and BillingProfileId, and both fields are in your Fact Table, Power BI struggles with activating both relationships at once.

 

Suggest some best practices:

Since many-to-many relationships can be tricky in Power BI, the best practice is to normalize your model by using a Bridge Table that contains unique combinations of BillingAccountId and BillingProfileId.

Create a distinct list of BillingAccountId and BillingProfileId from the PermissionTable.
Create a Bridge Table from this list.
Link:
Bridge Table → Fact Table (on BillingAccountId & BillingProfileId).
Permission Table → Bridge Table (on BillingAccountId & BillingProfileId).

If your goal is restricting access to data per user, you should use Dynamic RLS.

[Email] = USERPRINCIPALNAME()

enable RLS. 

If you must keep the current model, you can activate the inactive relationship in your calculations.

Total Cost =
CALCULATE(
SUM(FactTable[Cost]),
USERELATIONSHIP(PermissionTable[BillingProfileId], FactTable[BillingProfileId])
)





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thank you. 

 tried to implement your suggestions but still there is the issue with many to many relationships:

jaryszek_0-1739178267935.png
so I created a new column as new composite primary key BillingAccount-BillingProfile:

jaryszek_1-1739178657499.png

 

It is a good practice? 

On which relationships should i create RLS filters?

 

PermissionTable --> many to one -->Bridge Table:

jaryszek_2-1739178828451.png

 

BridgeTable --> 1 to many --> Fact Table 

?

Thank you for your help,
Best,
Jacek

 

 



Anonymous
Not applicable

Hi, @jaryszek 

 

Yes. Creating a new composite primary key like BillingAccount-BillingProfile can be a good practice to handle many-to-many relationships in Power BI. This approach helps in uniquely identifying each record and can simplify the relationships between tables.

 

For Row-Level Security (RLS) filters, it's generally more efficient to enforce them on dimension tables rather than fact tables. In your case, you should create the RLS filters on the PermissionTable and ensure that these filters propagate through the relationships to the Bridge Table and then to the Fact Table1.

 

Best Regards,

Community Support Team _Charlotte

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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