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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jrnhbc
Frequent Visitor

Build Model according to one entity being logged in (RLS), not many entities

I'm seeing poor performance because of loads of "many to many" relationships.

 

There's a table where the id is repeated for every possible combination of logged in entity, but each logged in entity would only ever see a set of unique ids from this.

 

e.g.

 

entity_idother_id
11
12
13
14
22
23
24
31

 

The report would only ever be used by one logged in entity, so all of these relationships stemming from this table should be one to one, or one to many. Many users / entities could never log on.

 

How can I model this properly so that it's optimised for a single user?

 

Nb the DWH is snowflake so the tables are embedded - hence every combination is in there.

 

 

2 REPLIES 2
AllisonKennedy
Super User
Super User

@jrnhbc  I'm not aware of a way to use RLS to alter the cardinality of relationships - Fabric might have something do this but not sure.

 

From a Power BI point of view, what you could do is add a column to the table to act as the primary key, where you combine the entity_id and other_id into one unique key. That way you can make the relationships 1 to many as you would expect when just one entity_id is logged in. 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Great idea - sadly can't use a composite key here as the subsequent tables in the relationship would only have other_id and not entity_id (which is why they're all demanding many to many relationships despite the fact in the published, embedded app this could never happen)

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.