Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi.
I need some advice or pointers on how I can solve a problem I now have. Frustration is mounting 😞
I have been using USERELATIONSHIP successfully in a measure that utilises an inactive relationship. The numbers are good, report looks great. Except, I also need to use RLS, which USERELATIONSHIP does not support. I must have missed that when implemented it in the first place.
I've browsed several posts on here and elsewhere, and I've not been able to make it work. The solutions are confusing or I haven't successfully adapted it to my report and data model.
https://www.daxpatterns.com/handling-different-granularities/
https://community.powerbi.com/t5/Desktop/Alternative-to-UserRelationship/m-p/641982
https://community.powerbi.com/t5/Desktop/RLS-with-Roleplaying/m-p/707605
https://community.powerbi.com/t5/Desktop/RLS-not-working-inactive-relation-and-measure/m-p/350464
https://community.powerbi.com/t5/Desktop/USERELATIONSHIP-and-RLS/m-p/787463
An abstracted overview of my scenario:
| Fact table [Job details] | Dimension table [Company] [has RLS] | |
| JobID [used for count] | CompanyKey | |
| CompanyKeyOwner | CompanyKey [M <--> 1] CompanyKey | |
| CompanyKeyPerformer | CompanyKey [M <--> 1] CompanyKey |
What I need the report to do:
With Company A as "owner" selected in the slicer, it filters the whole fact table by the CompanyKeyOwner column. I need to be able to apply that filter to the CompanyKeyPerformer column instead. The data is all in the same table, I just want to filter by the same value but on a different column. Is it not as simple as it seems?
I can do this no problem in SQL; select from table where CompanyKey is in Owner column; select from table where CompanyKey is in Performer column. Can't get my head around how to translate it to DAX functionality.
What are my options?
Duplicate either or both tables? Not sure how that'd help when I need to do aggregations and measures.
Some kind of FILTER expression a bit like in https://www.daxpatterns.com/handling-different-granularities/ ?
Here's a solution where you no longer need multiple relationships 🙂
https://www.villezekeviking.com/alternative-to-userelationship/
I wouldn't call it a particularly satisfactory solution, but I've got something working. Might help someone else who comes across a similar problem.
If I duplicate both the fact and dimension tables and set the relationships the right way for the situation (i.e. the reverse of the existing relationship), I can use a simple count on the id field in the visual. No crazy measure code required.
I just don't like having to have copies of the same table, but it is what it is. It means I also have to duplicate some of the page-level filters, or apply specific filters in the power query layer.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 134 | |
| 96 | |
| 78 | |
| 67 | |
| 65 |